Click here to Skip to main content
15,917,968 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Order(
Order_ID INT PRIMARY KEY AUTO_INCREMENT,
Customer_ID INT NOT NULL,
FOR...' at line 1

What I have tried:

Create table Order(
-> Order_ID INT PRIMARY KEY AUTO_INCREMENT,
-> Customer_ID INT NOT NULL,
-> FOREIGN KEY(Customer_ID) REFEERENCES Customer(Customer_ID),
-> Delivery INT NOT NULL,
-> FOREIGN KEY (Delivery) REFERENCES DELIVERY(Delivery_ID),
-> Ordered_Date DATE NOT NULL,
-> Required_Date DATE NOT NULL);
Posted
Updated 25-Apr-21 8:23am

1 solution

ORDER is a reserved word: Reserved Words - MariaDB Knowledge Base[^]
As such, you cannot use it as an identifier for any item: Tables and columns included.

Change the table name, or quote it every time you use it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900