unsigned表示无符号,也就是非负数,只能用于整型数据。
建立外键关系
create table dept(id smallint unsign auto_increment,name varchar

(50),primary key(id));

查看建立表的SQL代码
show create table dept \G;

create table employee (id smallint unsign auto_increment,name varchar

(100),deptno smallint unsigned,contraint fk_employee_deptno forgein key

(deptno) reference dept(id) on delete no action on update cascade,primary

key(id))

相关文章:

  • 2021-06-22
  • 2021-08-03
  • 2021-09-12
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2022-02-26
  • 2021-06-21
  • 2022-12-23
  • 2021-07-21
相关资源
相似解决方案