473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

A simple question on design

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
Nov 13 '05 #1
3 1196
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*****@noemail.net> wrote in message
news:10*************@corp.supernews.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

Nov 13 '05 #2
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******@pcdatasheet.com
www.pcdatasheet.com
"Mark H." <no*****@noemail.net> wrote in message
news:10*************@corp.supernews.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

Nov 13 '05 #3
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******************@newsread3.news.atl.earth link.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******@pcdatasheet.com
www.pcdatasheet.com
"Mark H." <no*****@noemail.net> wrote in message
news:10*************@corp.supernews.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


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Patchwork | last post by:
Hi Everyone, Please take a look at the following (simple and fun) program: //////////////////////////////////////////////////////////////////////////// ///////////// // Monster Munch, example...
0
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....
19
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...
17
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...
18
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...
4
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...
0
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
3
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...
7
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.