照书上做数据清洗的实验时遇到了问题
书上的代码
我的代码却出现了问题
下面是我的代码
mysql> use test
Database changed
mysql> create table user
-> <id char<6> not null primary key,
-> name char<6> not null,
-> major char<10> not null>;
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 '<id char<6> not null primary key,
name char<6> not null,
major char<10> not null' at line 2
mysql>
不是提示了么,id前面多了个<
这个是〈〉?我记得是()的括号
放大了仔细看,这两玩意不一样的,一个是尖括号,一个是圆括号
create table user
(id char(6) not null primary key,
name char(6) not null,
major char(10) not null);