Hello ppl,
I d like some help designing a customized contact list.
I have a table for people and a table for addresses.
In 99% of the cases one person will have one or more addresses so we have 1
to many there.
In very very rare cases one address will belong to more than one person. For
example, a husband and wife may be individual contacts but have the same
address.
I could either make a junction table PersonAddress just to accomodate the
rare cases (which will create an additional join when querying for
addresses), or I could make Address a weak entity whose primary key will be
the AddressID + PersonID. From a practical standpoint, which is the best way
to do it?
Many thanks folks
M 3 1200
Thinking and reading a bit more on this, I believe that the correct
assessment is that both solutions represent the same semantics, or the same
facts.
In one of them an address is an independent entity that may belong to many
people. In the other, the address must have an owner. Therefore, we should
normally choose the most economical solution, which I believe is to
represent address as a weak entity.
One less table and one less join.
What do you think?
M
"Mark H." <no*****@noemai l.net> wrote in message
news:10******** *****@corp.supe rnews.com... Hello ppl,
I d like some help designing a customized contact list. I have a table for people and a table for addresses. In 99% of the cases one person will have one or more addresses so we have 1 to many there. In very very rare cases one address will belong to more than one person. For example, a husband and wife may be individual contacts but have the same address.
I could either make a junction table PersonAddress just to accomodate the rare cases (which will create an additional join when querying for addresses), or I could make Address a weak entity whose primary key will be the AddressID + PersonID. From a practical standpoint, which is the best way to do it?
Many thanks folks
M
Hi Mark,
There's no point in making this complicated. You just need a table for
contacts with ContactID for the primary key and since any contact may have
more than one address a table for addresses with a primary key of AddressID.
The address table would also contain a ContactID field as a foreign key to
identify who the address record is for. The fact that two contacts may have
the same address is irrelevant. Addresses are typically treated as specific
to a person.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com
"Mark H." <no*****@noemai l.net> wrote in message
news:10******** *****@corp.supe rnews.com... Hello ppl,
I d like some help designing a customized contact list. I have a table for people and a table for addresses. In 99% of the cases one person will have one or more addresses so we have
1 to many there. In very very rare cases one address will belong to more than one person.
For example, a husband and wife may be individual contacts but have the same address.
I could either make a junction table PersonAddress just to accomodate the rare cases (which will create an additional join when querying for addresses), or I could make Address a weak entity whose primary key will
be the AddressID + PersonID. From a practical standpoint, which is the best
way to do it?
Many thanks folks
M
This is exactly the solution I was advocating.
Thanks for confirming.
A Person is essentially an "owner" of an address.
In formal terms, an Address becomes thus a weak entity.
Many thanks,
M.
"PC Datasheet" <no****@nospam. spam> wrote in message
news:j9******** **********@news read3.news.atl. earthlink.net.. . Hi Mark,
There's no point in making this complicated. You just need a table for contacts with ContactID for the primary key and since any contact may have more than one address a table for addresses with a primary key of AddressID. The address table would also contain a ContactID field as a foreign key to identify who the address record is for. The fact that two contacts may have the same address is irrelevant. Addresses are typically treated as specific to a person.
-- PC Datasheet Your Resource For Help With Access, Excel And Word Applications re******@pcdata sheet.com www.pcdatasheet.com
"Mark H." <no*****@noemai l.net> wrote in message news:10******** *****@corp.supe rnews.com... Hello ppl,
I d like some help designing a customized contact list. I have a table for people and a table for addresses. In 99% of the cases one person will have one or more addresses so we have 1 to many there. In very very rare cases one address will belong to more than one person. For example, a husband and wife may be individual contacts but have the same address.
I could either make a junction table PersonAddress just to accomodate the rare cases (which will create an additional join when querying for addresses), or I could make Address a weak entity whose primary key will be the AddressID + PersonID. From a practical standpoint, which is the best way to do it?
Many thanks folks
M
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Patchwork |
last post by:
Hi Everyone,
Please take a look at the following (simple and fun) program:
////////////////////////////////////////////////////////////////////////////
/////////////
// Monster Munch, example program
#include <list>
|
by: Mobile Boy 36 |
last post by:
I'm trying to make a very simple Textbox with a FocusColor property...When
the focus
changes to the
control, the backcolor must change automaticly to the color set by the
focusColor property.
Very simple, the control works fine when creating it dynamicly from code.
My aim is to add design functionality, so I can use it from the Visual
Studio .Net toolbox.
When I compile my code, no errors are reproted and Visual studio leaves a
|
by: Dales |
last post by:
I have a custom control that builds what we refer to as "Formlets"
around some content in a page. These are basically content "wrapper"
sections that are tables that have a colored header and provide an
open TD with a DIV in it for the content of this formlet. (The DIV is
for DHTML to hide and show the content)
I've created a web page showing step by step the two problems I'm
encountering. This problem is much easier to see than it...
|
by: RSH |
last post by:
I am really trying to grasp the concept of OOP as it applies to C#.
I am looking at trying to set up a simple Employee Class but I am having
trouble conceptualizing what this class should look like. I was hoping
someone might be able to simply outline what I envision my class to look
like:
Basically I am envisioning a Class called Employee:
I imagine it would have many properties(?) such as:
|
by: Bob Cummings |
last post by:
Not sure if this is the correct place or not. Anyhow in school we were
taught that when trying to calculate the efficiency of an algorithm to
focus on something called FLOPs or Floating Point operations and
disregard all integer operations.
My question is this. I am writing a simulation for animal dispersement
through large landscapes. We are loading data from several different
files to simulate the environment the animals will be...
| |
by: Shawnk |
last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the
Enum class (relative to boolean operations).
If this is true then (thus and therefore) you can not design state machines in
C# where the machine can use the enumerated 'state' to execute (thus the term
'machine' as in 'state machine') the machine operations as this requires
boolean operations to be performed on the state.
.....
|
by: odysseyphotography |
last post by:
Hi,
I'm trying to build a simple search for a database of jobs. Users can
search using three groups of critera:
1) Area (check boxes)
Buying and merchandising
Design
Executive
|
by: vicky |
last post by:
Hi All,
Can u please suggest me some books for relational database design or
database modelling(Knowledgeable yet simple) i.e. from which we could
learn database relationships(one to many,many to one
etc.....),building ER diagrams,proper usage of ER diagrams in our
database(Primary key foreign key relations),designing small
modules,relating tables and everything that relates about database
design....Coz I think database design is the...
|
by: CSharper |
last post by:
Yesterday I had a heated discussion with my colleagues on what is a
data centric application and having business logic in sql. I have
group of people who wants to include all the business logic in the sql
stored proc and I for one consider to have most of the business logic
in the C# code (specifically in a controller class of MVC). These are
my points to them.
1. Our application depends a lot on the data and we have huge amount
of data...
|
by: gnewsacct1 |
last post by:
I was going to design a simple movie database, but I'm just stuck in
the very begining.
It will contain the following information.
Country, Movie, Plot, Actors
So, I created tables like below.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |