MySQL Forums
Forum List  »  Newbie

Error when creating a table: is not valid at this position expecting an identifier.
Posted by: Arek xxx
Date: November 04, 2018 03:57AM

Hello, I have a problem when I try to use scripts to create a new tables in database. The error I keep getting is "Order" is not valid at this position expecting an identifier.
I have tried to create first Customer and Employee tables and then Order table but is still the same. Don't know what is wrong with this script? Thank you.

Create Table Customer
(
CustomerID Int Primary Key,
CustomerName varchar(20) Not Null,
CustomerContactNo varchar (10)Not Null,
CustomerAddress varchar(50)Not Null,
CustomerEmail varchar(25)Not Null
)
ENGINE=INNODB;


Create Table Employee
(
EmployeeID TinyInt Primary Key,
EmployeeName varchar(20) Not Null,
EmployeeContactNo varchar(10)Not Null,
EmployeeEmail varchar(25)Not Null
)
ENGINE=INNODB;


Create Table Order
(
OrderNo Int Primary Key,
Foreign Key(CustomerID) REFERENCES Customer(CustomerID),
Foreign Key(EmployeeID) REFERENCES Employee(EmployeeID)
)ENGINE=INNODB;

Options: ReplyQuote


Subject
Written By
Posted
Error when creating a table: is not valid at this position expecting an identifier.
November 04, 2018 03:57AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.