|  | Posted by jason.m.ho on 06/23/06 07:58 
Why does creating the following table give me the error: ERROR 1005(HY000): Can't create table (errno: 150)
 
 CREATE TABLE orderProducts (
 orderID integer(10),
 productID integer(10),
 quantity integer(10),
 PRIMARY KEY (orderID, productID),
 FOREIGN KEY (orderID) REFERENCES orders (orderID),
 FOREIGN KEY (productID) REFERENCES products (productID)
 );
 
 Can i not say that attributes that are part of the primary key are also
 foreign keys?
 
 - Jason
  Navigation: [Reply to this message] |