Quantcast
Channel: MySQL Forums - NDB clusters
Viewing all articles
Browse latest Browse all 1560

ERROR 1072 <42000> at line 7: Key column 'CustomerID' doesn't exist in table (1 reply)

$
0
0
Sorry, I'm really a newbie at this mysql stuff. So I tried to create a table called orders with the CustomerID as a foreign key. When I try to create the table I got this message:
ERROR 1072 <42000> at line 7: Key column 'CustomerID' doesn't exist in table

CREATE TABLE Orders
(
OrderID int NOT NULL AUTO_INCREMENT PRIMARY KEY,
Date varchar(8) NOT NULL,
Time varchar(4) NOT NULL,
SalesAmount varchar(4) NOT NULL,
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
) ;

I'm not sure what's wrong but does it have to do with "constraint"?

Thanks in advance for any help!

Viewing all articles
Browse latest Browse all 1560

Trending Articles