I wanted to create a table ORDER in database called Projects and which has another table CUSTOMER.
Here are the statements I used :
mysql> Create Table ORDER(
-> OrderNo Integer(5) Primary Key,
-> CustNo Integer(7),
-> ItemName Varchar(30),
-> Qty Integer(5),
-> Price Decimal(6,2) Not Null,
-> Foreign Key (CustNo) references CUSTOMER(CustID));
but I am getting this error :
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER(
OrderNo Integer(5) Primary Key,
CustNo Integer(7),
ItemName Varchar(30),
' at line 1
What is wrong here?