Jimi Hullegård wrote:comp.databases is probably the closest thing to a general SQL newsgroup.> [OK, first of all, I know this is not a MySQL specific question, but I
> couldn't find any newsgroup about SQL in general.]
Consider this example of a many-to-many table:> One of the statements was (translated from swedish):
> "A compound key is a primary key based on at least two foreign keys."
create table employeeProjectMapping (
employee_id integer not null references employee(employee_id),
project_id integer not null references project(project_id),
primary key(employee_id, project_id)
This fits the statement given in your exam. However, though the
statement is true, it is not a complete definition of a compound key.
It would have been more clear if the statement were, "One example of a
compound key is a primary key based on at least two foreign keys."
This is not the only use of compound keys. It is not unusual to define
a primary key over multiple columns, which are _not_ themselves foreign
Besides, the statement only mentioned "key" (unless there's an issue
with the translation from Swedish). I'm pretty sure "key" can refer to
a primary key, a foreign key, or even another set of columns that can be
used to identify records in the table.
In my opinion, you are correct in disputing this item on the exam. Good