composite, candidatekey [message #9177] |
Fri, 24 October 2003 10:06 |
Priyanka Shah
Messages: 19 Registered: January 2003
|
Junior Member |
|
|
Candidate key question
------------------------
How is the candidate key different from the primary key? (A candidate key is any field that could be used as a primary key it says in my book)
Composite key question
----------------------
A composite key is a unique key which is created by combining two or more fields. These fields are usually primary keys of other tables.
so student table has:
-----
s_id
s_name
s_address
Course table has
--------
course_id
course_name
--One student can take many courses
--One course can have many students
So being a many to many relationship we create another table enrollment.
This table has
--------
s_id
course_id
grade
So the composite key is combination of s_id and course_id My question is since this composite key is really used to create a unique primary key ..
What is the way to select this primary key? what does it look like?
|
|
|
|