【发布时间】:2022-09-30 15:37:54
【问题描述】:
我的代码:
CREATE DATABASE IF NOT EXISTS thogakade;
USE thogakade;
CREATE TABLE customer(
customerId VARCHAR(10),
name VARCHAR(50),
address TEXT,
salary DECIMAL(10,2),
CONSTRAINT PRIMARY KEY(customerId)
);
CREATE TABLE order(
orderId VARCHAR(30),
orderDate DATE NOT NULL,
custId VARCHAR(45),
CONSTRAINT PRIMARY KEY(orderId),
CONSTRAINT FOREIGN KEY(custId) REFERENCES customer(customerId)
);
这是我的代码,我无法创建订单表并收到此错误消息,
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(
orderId VARCHAR(30),
orderDate DATE NOT NULL,
custId VARCHAR(45),
CONSTRA\' at line 1
请给我一个解决方案。
标签: mysql