Click here to Skip to main content
15,913,263 members
Home / Discussions / Database
   

Database

 
GeneralNewbie help VS2003, SQLDataAdapter and Update Pin
Richard Schaefer9-May-05 9:19
Richard Schaefer9-May-05 9:19 
Generalunderstading if there is data inside a row filed Pin
Sasuko9-May-05 4:06
Sasuko9-May-05 4:06 
GeneralRe: understading if there is data inside a row filed Pin
Dave Kreskowiak9-May-05 5:37
mveDave Kreskowiak9-May-05 5:37 
Generalmy database is not case sensitive Pin
Sasuko9-May-05 3:48
Sasuko9-May-05 3:48 
GeneralRe: my database is not case sensitive Pin
Colin Angus Mackay9-May-05 5:06
Colin Angus Mackay9-May-05 5:06 
GeneralRe: my database is not case sensitive Pin
Sasuko10-May-05 12:38
Sasuko10-May-05 12:38 
GeneralDB Design-Going in circles Pin
hp1089-May-05 3:42
hp1089-May-05 3:42 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay9-May-05 4:44
Colin Angus Mackay9-May-05 4:44 
Sounds like you need some many-to-many joins

Okay - Let's try and put this in atomic bullet points.

* Address can belong to an individual
* Address can belong to a company
* Person can own 0, 1 or more companies
* Company can employ 0,1 or more persons
* Person can have a work address
* Person can have a home address
* A person can be employed by 0, 1 or more companies.

So, you have a person table, a company table and and address table. You also have some many-to-many joins which require intermediate tables, so you have a person_owns_company table and a company_employs_person table. These intermediate tables take the primary key from each side of the join and combine them together to make a compound primary key of its own.

So, if you have a PersonID and and CompanyID your person_owns_company table will have a compound primary key of PersonID and CompanyID. They also remain foreign keys back to their originating tables.

A person can have a homeAddressID column which will be a foreign key to the address table
A company can have an addressID column which, again, will be a foreign key for the address table.

You may wish to extend this futher as companies can have more than one location and the addressID may be better placed on a company_location table.

Does this help?


My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: DB Design-Going in circles Pin
hp1089-May-05 5:06
hp1089-May-05 5:06 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay9-May-05 5:13
Colin Angus Mackay9-May-05 5:13 
GeneralRe: DB Design-Going in circles Pin
hp1089-May-05 5:30
hp1089-May-05 5:30 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay9-May-05 5:57
Colin Angus Mackay9-May-05 5:57 
GeneralRe: DB Design-Going in circles Pin
hp1089-May-05 21:56
hp1089-May-05 21:56 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay9-May-05 22:47
Colin Angus Mackay9-May-05 22:47 
GeneralRe: DB Design-Going in circles Pin
hp1089-May-05 23:57
hp1089-May-05 23:57 
GeneralRe: DB Design-Going in circles Pin
hp10810-May-05 5:47
hp10810-May-05 5:47 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay10-May-05 6:03
Colin Angus Mackay10-May-05 6:03 
GeneralRe: DB Design-Going in circles Pin
hp10810-May-05 6:34
hp10810-May-05 6:34 
GeneralRe: DB Design-Going in circles Pin
Colin Angus Mackay10-May-05 6:53
Colin Angus Mackay10-May-05 6:53 
GeneralRe: DB Design-Going in circles Pin
hp10810-May-05 7:24
hp10810-May-05 7:24 
GeneralRe: DB Design-Going in circles Pin
jasncab10-May-05 14:29
jasncab10-May-05 14:29 
GeneralRe: DB Design-Going in circles Pin
hp10810-May-05 23:21
hp10810-May-05 23:21 
GeneralOracle 10G Pin
Member 17906978-May-05 22:47
Member 17906978-May-05 22:47 
GeneralRe: Oracle 10G Pin
jasncab11-May-05 6:07
jasncab11-May-05 6:07 
QuestionSQL Server 2000 to Access ? Pin
WDI8-May-05 7:01
WDI8-May-05 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.