1、创建外键

create table userinfo(
  uid int auto_increment primary key,
  name varchar(32),
  department_id int,
  xx_id int,
  constraint fk_user_depar foreign key (“department_id”) references color(“id”)
)engine=innodb default charset=utf8; 

create table department(   
  id bigint auto_increment primary key,   
  title char(15) 
)engine=innodb default charset=utf8;
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-02-06
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
猜你喜欢
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-01-20
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案