create table teacher_table1
(
tercher_id int auto_increment,
tercher_name varchar(255),
primary key(tercher_id)
);
create table student_table1
(
student_id int auto_increment primary key,
student_name varchar(255),
java_teacher int,
# java_teacher指定成本表的外键列,指定参照主表tercher_id
foreign key(java_teacher) references teacher_table1(tercher_id)
);
每天一张图