Question Locked

MySQL Database

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to create an orders table which has three primary keys which are related to two different tables. The problem being is I can only assign one of the required keys as a Primary key. Can anyone tell my how to correctly do this?

3 replies

by tony hopkinson

the other's Unique Keys.

Strange thing to do it's almost as if you have things bass ackwards.

Table1 with a prinary key
Table2 witha primary key

Table3 with a primary key and foreign keys, linked to Table1 and Table2

Would be a normal approach.

by dballiu

Hi, I guess you mean to have one primary key for your orders table plus two foreign keys pointing to the related tables.

This discussion is closed to new replies.