|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
I'm pretty new to databases and sql and i've been having some trouble figuring out the keys. I have certain schema I need to work with and think the primary keys would be EID and DID. However I'm having some trouble figuring out what the proper foreign keys are. Can anyone help me understand this concept. Thanks
By the way I'm working with this schema. Emp(eid:integer primary key, ename:string, age:integer, salary:integer) Dept(did:integer primary key, butget:integer, managerid:integer) Works(eid:integer primary key, did:integer primary key, work_time:integer) |
|
#2
|
||||
|
||||
|
primary key is what makes rows unique
a table can have only one primary key, but it can be a composite so the primary key of Works would be (eid, did) each of them is a foreign key to its respective parent table also, managerid in Dept is a foreign key to Emp rudy |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Primary and Foreign Keys |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|