mysql> use mydata;
Database changed
mysql> create table emp
(
empno int primary key,
ename varchar(10),
job varchar(10),
mgr int,
hiredate datetime,
sal double,
comm double,
deptno int
foreign int key (deptno) references dept(deptno)
);
1064 - 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 'foreign int key (deptno) references dept(deptno)
)' at line 11
mysql>
...全文
15512打赏收藏
MySQL建表出错 求解
mysql> use mydata; Database changed mysql> create table emp ( empno int primary key, ename varchar(10), job varchar(10), mgr int, hiredate datetime, sal double, comm double, deptno int foreign int key (deptno) references dept(deptno) ); 1064 - You ha
mysql> use mydata;
Database changed
mysql> create table emp
(
empno int primary key,
ename varchar(10),
job varchar(10),
mgr int,
hiredate datetime,
sal double,
comm double,
deptno int,
foreign int key (deptno) references dept(deptno)
);
1064 - 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 'int key (deptno) references dept(deptno)
)' at line 11
mysql>