WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Database Design Normalization help

 
Goto page Previous  1, 2, 3, 4
   Home -> Office other -> Table Design RSS
Next:  File Sharing Lock Error  
Author Message
Billiam

External


Since: Aug 27, 2007
Posts: 61



(Msg. 17) Posted: Fri Jul 25, 2008 6:32 am
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: microsoft>public>access>tablesdbdesign (more info?)

Somehow the following response from me was placed before my earlier response
in the thread (about starting a new thread) here it is again in case you did
not receive it:

"Duane Hookom" wrote:

> Stay in this thread as long as the question doesn't change.
>
> I would question any 1 to 1 relationships and consider place the fields into
> one table. Are the HumanResources and Instructors tables 1 to 1? How about
> the Status table to Instructors? Do you need to keep a history of statuses or
> just the current status?
>
> Your InstructorAddresses and Addresses tables look like they contain
> redundant information ie: CountryID and Country. I generally don't create
> lookup tables for cities, postal codes, countries, regions, etc.
>
> If a bunch of instructors don't share the same phone number, I wouldn't
> create a separate phones table. I would just place the phone numbers in the
> InstructorPhoneNumbers table.
>
> Can an instructor have more than one position?
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "Billiam" wrote:
>
> > Ok Duane, here is the link:
> > http://www.box.net/shared/z3wal6ncok
> >
> > Sorry to be such a pain--I really want to make sure I am using the right
> > type of relationships, in addition to the table layouts. After your
> > reccomendations, I will make changes and post what I've learned so others get
> > the benfits well.
> > "Duane Hookom" wrote:
> >
> > > I prefer to keep news group discussions public. Consider posting a jpg to a
> > > free file server like http://www.box.net/
> > >
> > > --
> > > Duane Hookom
> > > Microsoft Access MVP
> > >
> > >
> > > "Billiam" wrote:
> > >
> > > > Could I send you an e-mail invitation to view the relationship report on a
> > > > Microsoft Office Live Workspace?
> > > >
> > > > "Duane Hookom" wrote:
> > > >
> > > > > You shouldn't attempt to attach files to messages in public forums/news
> > > > > groups. You can find sites on the web that allow you to post files.
> > > > > --
> > > > > Duane Hookom
> > > > > Microsoft Access MVP
> > > > >
> > > > >
> > > > > "Billiam" wrote:
> > > > >
> > > > > > Since there are many tables and relationships, I was wondering if there was a
> > > > > > way to attach a relationship report in .pdf for you to see?
> > > > > >
> > > > > > "Duane Hookom" wrote:
> > > > > >
> > > > > > > You should type in your tables and fields as well as describe your
> > > > > > > relationships in a post to this news group.
> > > > > > >
> > > > > > > --
> > > > > > > Duane Hookom
> > > > > > > Microsoft Access MVP
> > > > > > >
> > > > > > >
> > > > > > > "Billiam" wrote:
> > > > > > >
> > > > > > > > I am a new user and have set up a database and relationships in Access 2007.
> > > > > > > > I was wondering if anyone could have a look at my design and offer any help
> > > > > > > > or suggestions, as I am finding it very difficult to comprehend relationships
> > > > > > > > despite all my looking and reading. If anyone is willing to help, I can
> > > > > > > > e-mail the database, or perhaps someone could let me know another way that
> > > > > > > > might be safer for someone to see what I have done in order to critique it or
> > > > > > > > offer help?
> > > > > > > > Thank you for any help as this is making my brain hurt!
Back to top
Login to vote
Duane Hookom

External


Since: Feb 07, 2005
Posts: 3294



(Msg. 18) Posted: Fri Jul 25, 2008 9:38 am
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It looks like your status table contains only a single record per instructor.
You would need to add at least one date field to note when the status
changed. I would change the name to tblInstructorStatusHistory and create a
separate lookup table for statuses.

If you want to keep a history of addresses, your table structures would be
similar and include a date field. If you want to create a combo box for
selecting a country, I wouldn't necessarily use a CountryID field unless you
had a meaningful Country ID. In the US, we have State names and State
Abbreviations the could be used on a lookup table.

Having the lookup table for regions, cities, and countries would not affect
the performance very much as long as there were proper indexes.
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

> "Duane Hookom" wrote:
>
>
> > I would question any 1 to 1 relationships and consider place the fields into
> > one table. Are the HumanResources and Instructors tables 1 to 1? How about
> > the Status table to Instructors?
>
> I am not sure if I am producing the relationships correctly...I will provide
> my business rules at the end of your replies, and perhaps this will clarify
> what I need to do as far as setting up my tables. I am not sure if I am
> utilizing/setting up foreign keys and junction tables...
>
> >Do you need to keep a history of statuses or just the current status?
>
> I need both the Current status AND a history of statuses.
> I assume I need to put FromDate and ToDate fields in the Status table?
>
> I also need to keep track of previous phone numbers, addresses and email/web
> info. Can you recommend what to do here?
>
> > Your InstructorAddresses and Addresses tables look like they contain
> > redundant information ie: CountryID and Country.
>
> My thinking was this is a many:many relationship based on the following Bus.
> rule:
> One Instructor has many addresses
> One address has many Instructors (Husband, wife and sometimes son/daughter)
> I made a junction table (InstructorAddresses) and thought I needed the
> Country ID as a foreign key in the junction table InstructorAddresses?
>
> >I generally don't create lookup tables for cities, postal codes, countries, regions, etc.
>
> I was wondering if I am tryng to over normalize these items. I often have to
> search on City, and regions typically do not change, but I have heard some
> talk lately of possibly revamping which region applies to which address and
> also to which region description, and so I thought it might be easier to
> break these items up in order to change them more easily. Also, I thought it
> would not hurt to have the database prepared should we become more global and
> so I added a seperate Country table...it seemed to me I read something about
> having these in seperate tables as they were transitively dependent on the
> key, or something like that...will this design slow things down too much
> building the junction table CityPostalCode? It seems to me I remember reading
> about a way to help this by having the sort not begn until a certain number
> of letters appeared (for example, no sorting until "New York" was entered. I
> do need your advice on this.
>
>
>
> > If a bunch of instructors don't share the same phone number, I wouldn't
> > create a separate phones table. I would just place the phone numbers in the
> > InstructorPhoneNumbers table.
>
> So I do not need the many:many relationship here, I can just use a 1:to many
> relationship between Instructors and instructors phones? BTW, About 20% of
> Instructors do share phone numbers. Could you explain why you wouldn't use a
> seperate phones table so I might understand a little better what I am doing?
> I think you will probaly say that too many tables will become difficult to
> manage with queries and reports?
>
> Since there is a possibility that this database could be asked to be
> extended to accept sales of a few items, and therefore inventory (about 30
> items), do you have any reccomendations for keeping the design flexible
> enough to handle the possibilty of Customers, Orders, CustomerOrders and
> adding them in with their multitude of address types?
>
> > Can an instructor have more than one position?
>
> Yes, they can be on the executive, Board, Auditors etc.
>
> Finally, Duane, I am not sure how to handle the following problem. I use the
> database to produse a report of Instructors who wish to have their Name,
> City, Phone Number, E-mail, website and which qualifications they have
> available to the public. A person can click on a particular area code on the
> website, and then a list of instructors in that areacode is provided (a .pdf
> report uploaded to the website) Here is the problem...To complicate things,
> the Instructors given names are entered into the database, not their
> nicknames or known by names. So I need to pull, for example, all Instructors
> who are Active Status, include their preferred first name--not their given
> name as entered in the database,(so do I add this as a field in the
> Instructor Table as PrefferedFirstName?) LastName, City--This is my other
> problem---Instructors can list up to three cities to be included on the
> website (surrounding areas), and I am only tracking one city per address so
> not sure how to handle that...Phone number (could be home or business or
> cell--this is the instructors personal preference ) finally qualifications.
> So how do I handle tagging that this first name, these cities and this phone
> number are "Public"...do I add public as an address type, city as a CityType,
> ? And what do I do about PreferredFirstName?
>
> Thank you for any help you can provide! I have really been wrestling with
> this for awhile. I am currently using a flat table design as I got the job of
> doing the database for a non-profit organization and had no experience...live
> and learn!
> Billiam
> > --
> > Duane Hookom
> > Microsoft Access MVP
> >
> >
> > "Billiam" wrote:
> >
> > > Ok Duane, here is the link:
> > > http://www.box.net/shared/z3wal6ncok
> > >
> > > Sorry to be such a pain--I really want to make sure I am using the right
> > > type of relationships, in addition to the table layouts. After your
> > > reccomendations, I will make changes and post what I've learned so others get
> > > the benfits well.
> > > "Duane Hookom" wrote:
> > >
> > > > I prefer to keep news group discussions public. Consider posting a jpg to a
> > > > free file server like http://www.box.net/
> > > >
> > > > --
> > > > Duane Hookom
> > > > Microsoft Access MVP
> > > >
> > > >
> > > > "Billiam" wrote:
> > > >
> > > > > Could I send you an e-mail invitation to view the relationship report on a
> > > > > Microsoft Office Live Workspace?
> > > > >
> > > > > "Duane Hookom" wrote:
> > > > >
> > > > > > You shouldn't attempt to attach files to messages in public forums/news
> > > > > > groups. You can find sites on the web that allow you to post files.
> > > > > > --
> > > > > > Duane Hookom
> > > > > > Microsoft Access MVP
> > > > > >
> > > > > >
> > > > > > "Billiam" wrote:
> > > > > >
> > > > > > > Since there are many tables and relationships, I was wondering if there was a
> > > > > > > way to attach a relationship report in .pdf for you to see?
> > > > > > >
> > > > > > > "Duane Hookom" wrote:
> > > > > > >
> > > > > > > > You should type in your tables and fields as well as describe your
> > > > > > > > relationships in a post to this news group.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Duane Hookom
> > > > > > > > Microsoft Access MVP
> > > > > > > >
> > > > > > > >
> > > > > > > > "Billiam" wrote:
> > > > > > > >
> > > > > > > > > I am a new user and have set up a database and relationships in Access 2007.
> > > > > > > > > I was wondering if anyone could have a look at my design and offer any help
> > > > > > > > > or suggestions, as I am finding it very difficult to comprehend relationships
> > > > > > > > > despite all my looking and reading. If anyone is willing to help, I can
> > > > > > > > > e-mail the database, or perhaps someone could let me know another way that
> > > > > > > > > might be safer for someone to see what I have done in order to critique it or
> > > > > > > > > offer help?
> > > > > > > > > Thank you for any help as this is making my brain hurt!
Back to top
Login to vote
Billiam

External


Since: Aug 27, 2007
Posts: 61



(Msg. 19) Posted: Tue Jul 29, 2008 11:35 am
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for your help so far Duane, I really appreciate it !!!!

It seems that while I may understand that a many to many relationship is
resolved by using an intermediate table or Junction table, with each entity
on the one side of a many relationship to the junction box, my relationship
diagram does not reflect that...which leads me to thinking I am not doing
something correctly.
Can you tell me if this is the correct procedure for the following many to
many realtionship?

tblInstructors
instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
integrity enforced)
Instructor ID# (starts with zeros so a text field)
FirstName
Midname
Lastname

tblAddresses
AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
integrity enforced)
AddressLine1
AddressLine2
AddressLine3
City
ProvinceStateCounty
PostalCode
Country


tblInstructorAddresses
InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
Duplicates,ref. integrity enforced)
InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
AddressID (FK, Index Yes No Duplicates JOIN Type 1)

As you can see from my relationship report, InstructorID in tblInstructors
is realted one to many with InstructorID in tblInstructorAddresses. It is my
understanding that this is how every many to many realtionship is resolved.
You will note, however, that AddressID from tblAddresses realtes to AddressID
in tblInstructorAddresses as a one to one---not a one to many as I suspect it
should. Why is this happening, Duane? (BTW, I create the realtionship by
taking the primary ID from the table and dropping it on top of the
foreignkeyiD in the junction/intermediate table.)

The really odd thing is that when i click on edit the relationship for
Instructor to instructoraddress it says it is a one to one relationship
between the instructorID's, however, the diagram clearly shows it as a one to
many relationship! Man am I confused!

Billiam
Back to top
Login to vote
Duane Hookom

External


Since: Feb 07, 2005
Posts: 3294



(Msg. 20) Posted: Tue Jul 29, 2008 11:48 am
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Your design:
InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
AddressID (FK, Index Yes No Duplicates JOIN Type 1)

Your FK should allow duplicates. The fields normally would be Long Integer
depending on the data type in the instructor and address tables. You can
create a unique index on a combination of the InstructorID and AddressID.

--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

> Thanks for your help so far Duane, I really appreciate it !!!!
>
> It seems that while I may understand that a many to many relationship is
> resolved by using an intermediate table or Junction table, with each entity
> on the one side of a many relationship to the junction box, my relationship
> diagram does not reflect that...which leads me to thinking I am not doing
> something correctly.
> Can you tell me if this is the correct procedure for the following many to
> many realtionship?
>
> tblInstructors
> instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> integrity enforced)
> Instructor ID# (starts with zeros so a text field)
> FirstName
> Midname
> Lastname
>
> tblAddresses
> AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> integrity enforced)
> AddressLine1
> AddressLine2
> AddressLine3
> City
> ProvinceStateCounty
> PostalCode
> Country
>
>
> tblInstructorAddresses
> InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
> Duplicates,ref. integrity enforced)
> InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
> AddressID (FK, Index Yes No Duplicates JOIN Type 1)
>
> As you can see from my relationship report, InstructorID in tblInstructors
> is realted one to many with InstructorID in tblInstructorAddresses. It is my
> understanding that this is how every many to many realtionship is resolved.
> You will note, however, that AddressID from tblAddresses realtes to AddressID
> in tblInstructorAddresses as a one to one---not a one to many as I suspect it
> should. Why is this happening, Duane? (BTW, I create the realtionship by
> taking the primary ID from the table and dropping it on top of the
> foreignkeyiD in the junction/intermediate table.)
>
> The really odd thing is that when i click on edit the relationship for
> Instructor to instructoraddress it says it is a one to one relationship
> between the instructorID's, however, the diagram clearly shows it as a one to
> many relationship! Man am I confused!
>
> Billiam
>
Back to top
Login to vote
Billiam

External


Since: Aug 27, 2007
Posts: 61



(Msg. 21) Posted: Tue Jul 29, 2008 12:09 pm
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes, now the relationships are one to many, thanks!

"Duane Hookom" wrote:

You can create a unique index on a combination of the InstructorID and
AddressID.

To clarify,does this mean I do not need the InstructorAddressesID as the
Primary key in tblInstructorAddresses? And if so, does this also mean that
the InstructorID and AddressID foreign keys combo make up the primary key of
tblInstructorAddresses as a composite key?

Billiam
> "Billiam" wrote:
>
> > Thanks for your help so far Duane, I really appreciate it !!!!
> >
> > It seems that while I may understand that a many to many relationship is
> > resolved by using an intermediate table or Junction table, with each entity
> > on the one side of a many relationship to the junction box, my relationship
> > diagram does not reflect that...which leads me to thinking I am not doing
> > something correctly.
> > Can you tell me if this is the correct procedure for the following many to
> > many realtionship?
> >
> > tblInstructors
> > instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > integrity enforced)
> > Instructor ID# (starts with zeros so a text field)
> > FirstName
> > Midname
> > Lastname
> >
> > tblAddresses
> > AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > integrity enforced)
> > AddressLine1
> > AddressLine2
> > AddressLine3
> > City
> > ProvinceStateCounty
> > PostalCode
> > Country
> >
> >
> > tblInstructorAddresses
> > InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
> > Duplicates,ref. integrity enforced)
> > InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
> > AddressID (FK, Index Yes No Duplicates JOIN Type 1)
> >
> > As you can see from my relationship report, InstructorID in tblInstructors
> > is realted one to many with InstructorID in tblInstructorAddresses. It is my
> > understanding that this is how every many to many realtionship is resolved.
> > You will note, however, that AddressID from tblAddresses realtes to AddressID
> > in tblInstructorAddresses as a one to one---not a one to many as I suspect it
> > should. Why is this happening, Duane? (BTW, I create the realtionship by
> > taking the primary ID from the table and dropping it on top of the
> > foreignkeyiD in the junction/intermediate table.)
> >
> > The really odd thing is that when i click on edit the relationship for
> > Instructor to instructoraddress it says it is a one to one relationship
> > between the instructorID's, however, the diagram clearly shows it as a one to
> > many relationship! Man am I confused!
> >
> > Billiam
> >
Back to top
Login to vote
Duane Hookom

External


Since: Feb 07, 2005
Posts: 3294



(Msg. 22) Posted: Tue Jul 29, 2008 12:31 pm
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I almost always create a single primary key field in a table which is
generally an autonumber. I do this because I create lots of web pages and I
would like to pass the value of a single field to a web page for editing a
single record.

You could remove the autonumber primary key in a small junction table if you
want and replace it with the combination of the two fields. I wouldn't
because I am lazy (consistently lazy Wink
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

> Yes, now the relationships are one to many, thanks!
>
> "Duane Hookom" wrote:
>
> You can create a unique index on a combination of the InstructorID and
> AddressID.
>
> To clarify,does this mean I do not need the InstructorAddressesID as the
> Primary key in tblInstructorAddresses? And if so, does this also mean that
> the InstructorID and AddressID foreign keys combo make up the primary key of
> tblInstructorAddresses as a composite key?
>
> Billiam
> > "Billiam" wrote:
> >
> > > Thanks for your help so far Duane, I really appreciate it !!!!
> > >
> > > It seems that while I may understand that a many to many relationship is
> > > resolved by using an intermediate table or Junction table, with each entity
> > > on the one side of a many relationship to the junction box, my relationship
> > > diagram does not reflect that...which leads me to thinking I am not doing
> > > something correctly.
> > > Can you tell me if this is the correct procedure for the following many to
> > > many realtionship?
> > >
> > > tblInstructors
> > > instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > integrity enforced)
> > > Instructor ID# (starts with zeros so a text field)
> > > FirstName
> > > Midname
> > > Lastname
> > >
> > > tblAddresses
> > > AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > integrity enforced)
> > > AddressLine1
> > > AddressLine2
> > > AddressLine3
> > > City
> > > ProvinceStateCounty
> > > PostalCode
> > > Country
> > >
> > >
> > > tblInstructorAddresses
> > > InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
> > > Duplicates,ref. integrity enforced)
> > > InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
> > > AddressID (FK, Index Yes No Duplicates JOIN Type 1)
> > >
> > > As you can see from my relationship report, InstructorID in tblInstructors
> > > is realted one to many with InstructorID in tblInstructorAddresses. It is my
> > > understanding that this is how every many to many realtionship is resolved.
> > > You will note, however, that AddressID from tblAddresses realtes to AddressID
> > > in tblInstructorAddresses as a one to one---not a one to many as I suspect it
> > > should. Why is this happening, Duane? (BTW, I create the realtionship by
> > > taking the primary ID from the table and dropping it on top of the
> > > foreignkeyiD in the junction/intermediate table.)
> > >
> > > The really odd thing is that when i click on edit the relationship for
> > > Instructor to instructoraddress it says it is a one to one relationship
> > > between the instructorID's, however, the diagram clearly shows it as a one to
> > > many relationship! Man am I confused!
> > >
> > > Billiam
> > >
Back to top
Login to vote
Billiam

External


Since: Aug 27, 2007
Posts: 61



(Msg. 23) Posted: Tue Jul 29, 2008 12:46 pm
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sorry, Duane, I am not sure what you meant by "You can create a unique index
on a combination of the InstructorID and AddressID." as stated a few threads
back...
I am not sure if you were offering another way to index the junction table,
or ? Sorry, I am really new to this, and sometimes all the reading I've done
just makes you more confused!


"Duane Hookom" wrote:

> I almost always create a single primary key field in a table which is
> generally an autonumber. I do this because I create lots of web pages and I
> would like to pass the value of a single field to a web page for editing a
> single record.
>
> You could remove the autonumber primary key in a small junction table if you
> want and replace it with the combination of the two fields. I wouldn't
> because I am lazy (consistently lazy Wink
> --
> Duane Hookom
> Microsoft Access MVP
>
>
> "Billiam" wrote:
>
> > Yes, now the relationships are one to many, thanks!
> >
> > "Duane Hookom" wrote:
> >
> > You can create a unique index on a combination of the InstructorID and
> > AddressID.
> >
> > To clarify,does this mean I do not need the InstructorAddressesID as the
> > Primary key in tblInstructorAddresses? And if so, does this also mean that
> > the InstructorID and AddressID foreign keys combo make up the primary key of
> > tblInstructorAddresses as a composite key?
> >
> > Billiam
> > > "Billiam" wrote:
> > >
> > > > Thanks for your help so far Duane, I really appreciate it !!!!
> > > >
> > > > It seems that while I may understand that a many to many relationship is
> > > > resolved by using an intermediate table or Junction table, with each entity
> > > > on the one side of a many relationship to the junction box, my relationship
> > > > diagram does not reflect that...which leads me to thinking I am not doing
> > > > something correctly.
> > > > Can you tell me if this is the correct procedure for the following many to
> > > > many realtionship?
> > > >
> > > > tblInstructors
> > > > instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > > integrity enforced)
> > > > Instructor ID# (starts with zeros so a text field)
> > > > FirstName
> > > > Midname
> > > > Lastname
> > > >
> > > > tblAddresses
> > > > AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > > integrity enforced)
> > > > AddressLine1
> > > > AddressLine2
> > > > AddressLine3
> > > > City
> > > > ProvinceStateCounty
> > > > PostalCode
> > > > Country
> > > >
> > > >
> > > > tblInstructorAddresses
> > > > InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
> > > > Duplicates,ref. integrity enforced)
> > > > InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
> > > > AddressID (FK, Index Yes No Duplicates JOIN Type 1)
> > > >
> > > > As you can see from my relationship report, InstructorID in tblInstructors
> > > > is realted one to many with InstructorID in tblInstructorAddresses. It is my
> > > > understanding that this is how every many to many realtionship is resolved.
> > > > You will note, however, that AddressID from tblAddresses realtes to AddressID
> > > > in tblInstructorAddresses as a one to one---not a one to many as I suspect it
> > > > should. Why is this happening, Duane? (BTW, I create the realtionship by
> > > > taking the primary ID from the table and dropping it on top of the
> > > > foreignkeyiD in the junction/intermediate table.)
> > > >
> > > > The really odd thing is that when i click on edit the relationship for
> > > > Instructor to instructoraddress it says it is a one to one relationship
> > > > between the instructorID's, however, the diagram clearly shows it as a one to
> > > > many relationship! Man am I confused!
> > > >
> > > > Billiam
> > > >
Back to top
Login to vote
Duane Hookom

External


Since: Nov 30, 2006
Posts: 2



(Msg. 24) Posted: Tue Jul 29, 2008 3:25 pm
Post subject: RE: Database Design Normalization help [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

When you view the indexes in your table design view, you have the opportunity
to select more than one field and provide a single name for the index. You
can set these indexes to not allow duplicates. This is an alternative to the
single field primary key. I usually create a single field primary key and a
unique index on the other foreign key fields.

"Billiam" wrote:

> Sorry, Duane, I am not sure what you meant by "You can create a unique index
> on a combination of the InstructorID and AddressID." as stated a few threads
> back...
> I am not sure if you were offering another way to index the junction table,
> or ? Sorry, I am really new to this, and sometimes all the reading I've done
> just makes you more confused!
>
>
> "Duane Hookom" wrote:
>
> > I almost always create a single primary key field in a table which is
> > generally an autonumber. I do this because I create lots of web pages and I
> > would like to pass the value of a single field to a web page for editing a
> > single record.
> >
> > You could remove the autonumber primary key in a small junction table if you
> > want and replace it with the combination of the two fields. I wouldn't
> > because I am lazy (consistently lazy Wink
> > --
> > Duane Hookom
> > Microsoft Access MVP
> >
> >
> > "Billiam" wrote:
> >
> > > Yes, now the relationships are one to many, thanks!
> > >
> > > "Duane Hookom" wrote:
> > >
> > > You can create a unique index on a combination of the InstructorID and
> > > AddressID.
> > >
> > > To clarify,does this mean I do not need the InstructorAddressesID as the
> > > Primary key in tblInstructorAddresses? And if so, does this also mean that
> > > the InstructorID and AddressID foreign keys combo make up the primary key of
> > > tblInstructorAddresses as a composite key?
> > >
> > > Billiam
> > > > "Billiam" wrote:
> > > >
> > > > > Thanks for your help so far Duane, I really appreciate it !!!!
> > > > >
> > > > > It seems that while I may understand that a many to many relationship is
> > > > > resolved by using an intermediate table or Junction table, with each entity
> > > > > on the one side of a many relationship to the junction box, my relationship
> > > > > diagram does not reflect that...which leads me to thinking I am not doing
> > > > > something correctly.
> > > > > Can you tell me if this is the correct procedure for the following many to
> > > > > many realtionship?
> > > > >
> > > > > tblInstructors
> > > > > instructorID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > > > integrity enforced)
> > > > > Instructor ID# (starts with zeros so a text field)
> > > > > FirstName
> > > > > Midname
> > > > > Lastname
> > > > >
> > > > > tblAddresses
> > > > > AddressID (PK, autonumber, Long Integer, Yes Index NO Duplicates,ref.
> > > > > integrity enforced)
> > > > > AddressLine1
> > > > > AddressLine2
> > > > > AddressLine3
> > > > > City
> > > > > ProvinceStateCounty
> > > > > PostalCode
> > > > > Country
> > > > >
> > > > >
> > > > > tblInstructorAddresses
> > > > > InstructorAddressID (PK, autonumber, Long Integer, Yes Index NO
> > > > > Duplicates,ref. integrity enforced)
> > > > > InstructorID (FK, Index Yes No duplicates, JOIN Type 1)
> > > > > AddressID (FK, Index Yes No Duplicates JOIN Type 1)
> > > > >
> > > > > As you can see from my relationship report, InstructorID in tblInstructors
> > > > > is realted one to many with InstructorID in tblInstructorAddresses. It is my
> > > > > understanding that this is how every many to many realtionship is resolved.
> > > > > You will note, however, that AddressID from tblAddresses realtes to AddressID
> > > > > in tblInstructorAddresses as a one to one---not a one to many as I suspect it
> > > > > should. Why is this happening, Duane? (BTW, I create the realtionship by
> > > > > taking the primary ID from the table and dropping it on top of the
> > > > > foreignkeyiD in the junction/intermediate table.)
> > > > >
> > > > > The really odd thing is that when i click on edit the relationship for
> > > > > Instructor to instructoraddress it says it is a one to one relationship
> > > > > between the instructorID's, however, the diagram clearly shows it as a one to
> > > > > many relationship! Man am I confused!
> > > > >
> > > > > Billiam
> > > > >
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Table Design All times are: Eastern Time (US & Canada) (change)
Goto page Previous  1, 2, 3, 4
Page 3 of 4

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET