时间:2021-07-01 10:21:17 帮助过:2人阅读
# 创建学生表
create table student(age int,name varchar(32))engine myisam charset utf8;
insert into student values(18,‘小白‘);
# 创建教师表,结构与学生表结构一模一样
create table teacher like student;
# 把学生表的数据写进教师表中
insert into teacher select * from student;
# 创建家长表,结构与数据与学生表一模一样
create table parent select * from student;
#创建学校表,结构与学生表一样
create table school select * from student where 1 = 2;#即条件不成立
MySql中,复制旧表结构到新表
标签: