mysql - Getting error 1064 while running query for table creation? -
i have created customers , products table.i getting error while running following command in phpmyadmin.
create table orders ( id int not null auto_increment, ordernumber int, productid int, customerid int, orderdate datetime default current_timestamp, primary key(id), primary key (customerid) references customers(id) , foreign key (productid) references products(id) );
can not create more 1 primary keys.
try code.
create table orders ( id int not null auto_increment, ordernumber int, productid int, customerid int, orderdate datetime default current_timestamp, primary key(id), foreign key (customerid) references customers(id) , foreign key (productid) references products(id));
Comments
Post a Comment