- Total Members: 220,034
- Threads: 525,390
- Posts: 977,005
-
February 7th, 2013, 01:03 AM
#1
Database Layout Question
Help
I am in need of some help laying out my database.
I have the following tables that I need to relate to each other but I can't think of the correct way to do it
1. Grocery Chain Headquarters - contains information on address, contact information etc. (PK - ChainID)
2. Store Locations - contains information on each Store in the Chain, address, contact etc. (PK - StoreID)
3. Incedent - contains information about an incedent that could effect 1 or more Stores ( power outage, tornado, equipment failure etc ).(PK - IncedentID)
4. Items - Items within the store that have to be written off or marked down due to the incedent.(PK - UPC)
1st Level is the Headquarters Table
4thLevel is the Items Table
Now the problem is the 2nd and 3rd level
The Headquarters has many Locations just as a Location may have many Incedents
The Headquarter also has many Incedents and those Incedents may have many Locations
If I have the Location as the 2nd Level, then I have to have mutiple Incedent records if the Incedent effects more than one Location and in reverse
If I have the Incedent as the 2nd Level, then I have to have mutiple Location records - 1 for each Incedent.
I sure hope someone can fix my brain fart, because I am currentlly stuck.
Mark Moss
-
February 8th, 2013, 10:42 AM
#2
it looks like you need one more table incident_location just incidentId and Location_ID
GK
__________________________________________________ _____
if you found this post is useful click scale

(right side on this reply ) and agree
-
February 8th, 2013, 12:05 PM
#3
gk53
Thank you so very much for your reply, and you are absolutlly correct with adding the intersection table.
Mark Moss
Similar Threads
-
By serax in forum Microsoft Access Help
Replies: 3
Last Post: January 31st, 2010, 01:46 PM
-
By djfiii in forum HTML, JavaScript And CSS Help
Replies: 1
Last Post: January 24th, 2007, 12:36 PM
-
By DavieCooper in forum .NET Development
Replies: 1
Last Post: November 15th, 2006, 10:49 AM
-
By bigbigcow in forum HTML, JavaScript And CSS Help
Replies: 4
Last Post: October 9th, 2006, 01:14 PM
-
By Jon2112 in forum ASP Development
Replies: 2
Last Post: April 27th, 2004, 06:15 PM