-- 实验表结构
create table student(
id int,
name varchar(15),
gender varchar(15),
cid int
);
create table class(
cid int,
cname varchar(15)
);
drop table student,class;
-- 实验表数据:
insert into student values(1,"lilei","male",1),(2,"hanmeimei","male",2),(3,"jack","male",1),(4,"alice","female",4); --这里特意创建了一个class中没有的4
insert into class values(1,"linux"),(2,"python"),(3,"java"),(5,"html5");--这里特意创建了一个student中没有的5
select * from student;
select * from class;
更多关于MySQL相关内容感兴趣的读者可查看本站专题:《MySQL查询技巧大全》、《MySQL事务操作技巧汇总》、《MySQL存储过程技巧大全》、《MySQL数据库锁相关技巧汇总》及《MySQL常用函数大汇总》