MYSQL ERROR 1064(42000)

mysql> CREATE TABLE EMPLOYEE_PAY_TBL
-> (
-> EMP_ID VARCHAR(9) NOT NULL PRIMARY KEY,
-> POSITION VARCHAR(15) NOT NULL,
-> DATE_HIRE DATE,
-> PAY_RATE DECIMAL(4,2),
-> DATE_LAST_RAISE DATE,
-> SALARY DECIMAL(8,2),
-> BONUS DECIMAL(6,2),
-> CONSTRAINT EMP_FK FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE_TBL (EMP_ID)
-> );
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 'KEY,
POSITION VARCHAR(15) NOT NULL,
DATE_HIRE DATE,
PAY_RATE DECIMAL(4,2),
DAT' at line 3

https://img2.mukewang.com/5b56dc9900012c8609770322.jpg

https://img3.mukewang.com/5b56dca200015bf416540681.jpg

烙印99
浏览 2579回答 1
1回答

精慕HU

KEY,换成 KEY,关键是要理解语法,以及善于利用错误信息排查,这里已经告诉你了,错误在KEY附近,而不是照抄书上,否则那么多字哪里能抄对呢。
打开App,查看更多内容
随时随地看视频慕课网APP