mysql> CREATE TABLE department(
-> d_id INT(4) NOT NULL UNIQUE PRIMARY KEY,
-> d_name VARCHAR(20) NOT NULL UNIQUE,
-> function VARCHAR(50),
-> address VARCHAR(50)
-> );
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 'function VARCHAR(50),
address VARCHAR(50)
)' at line 4
function字段有问题,function是数据库关键字,一般不让作为列明使用,可以换个名字