0

I have this following code to create an Order table in my database:

create table order(
order_id int primary key not null auto_increment,
product_id int not null,
customer_id int not null,
date_created datetime not null default now(),
date_modified datetime not null default now(),
order_status varchar(25),
foreign key(product_id) references product(product_id),
foreign key(customer_id) references customer(customer_id));

but when I execute it I get this error:

You have an error in you SQL syntax:check the manual that corresponds to your Mysql server version for the right syntaxt to use near'order(order_id int primary key not null auto_increment,product_id int not null,c'

Please help e figure out what's the issue.

Alladin
  • 1,010
  • 3
  • 27
  • 45

0 Answers0