Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Database Design

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-08-2010, 03:20 PM
corquando corquando is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: Feb 2010
Posts: 4
corquando is on a distinguished road
Default World's simplest question

Hi, all.

I am going for the record of "World's Simplest Question."

I'm new to Access, although a seasoned hand at Excel/VBA, so my lack of perception is frustrating.

In the book I have obtained to help me is the following quote:

"A one-to-many relationship is created by placing the value primary key of one table into the other table as a foreign key(empahsis mine.) For example, the customer number, which is the primary key of the customers table, becomes the foreign key of the orders table."

In theory, fine. This is so that for every order recorded, the orders table doesn't need an additional 17 fields duplicating every customers' data every time. The link between the customer number field and the customers table takes care of that.

The dilemma: Wouldn't there already be a customer identification field someplace in the orders table, and if there isn't, how will the insertion of the customer number fields guarantee the correct customer number will go with the correct order?

If there already is a customer id field, then simply designating that as the foreign key for this relationship is elementary - it's the "placing into" part that I can't get my head around: Simply, when inserting the column of customer ids, "How will it know?"

Thanks and I hope I don't sound like a whiney boob.
Reply With Quote
  #2  
Old 02-08-2010, 05:02 PM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline Windows XP Access 2003 (version 11.0)
Simulacrum
 
Join Date: Jan 2010
Location: Victoria, Canada
Posts: 186
ConneXionLost is on a distinguished road
Default

Hi corquando,

The word syntax from your book is describing what you should do if you're "designing" a database and the tables have not yet been built, or at least, filled with data.

It appears you're asking your question (of what the book says) from the perspective that the tables & data already exist, and as you've surmised, it's a little late by then.

Cheers,
__________________
Docendo discimus.

Please:
  • Use code tags. Place your code between [CODE] and [/CODE] tags.
  • Don't cross post. But if you feel you must, please do so Politely.
  • Clean up when you're done. Mark your thread Solved if you received your answer.
  • Thank those who helped you. Click the scales icon (Reputation) in the upper right corner of the contributor's post.
Reply With Quote
  #3  
Old 02-09-2010, 02:46 AM
corquando corquando is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: Feb 2010
Posts: 4
corquando is on a distinguished road
Default It's all in how you look at it . . .

And there we have it.

I had nightmares of having to manually enter 25000 records or some such by, as you say, coming upon the scene late, but your explanation provides the necessary perspective.

Thanks.

BTW, I extensively use the Excel/VBA forum that this looks to be a sister to, so finding this one is going to be a real boon. And I do search for existing answers before posting . . . usually.

Thanks again!
Reply With Quote
Reply

Bookmarks

Tags
foreign, key, primary

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplest question... andrewhunt Reports 1 01-20-2009 07:34 AM


All times are GMT -8. The time now is 02:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.