-- 實驗表結構
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;
-- 實驗表數(shù)據(jù):
insert into student values(1,"lilei","male",1),(2,"hanmeimei","male",2),(3,"jack","male",1),(4,"alice","female",4); --這里特意創(chuàng)建了一個class中沒有的4
insert into class values(1,"linux"),(2,"python"),(3,"java"),(5,"html5");--這里特意創(chuàng)建了一個student中沒有的5
select * from student;
select * from class;
更多關于MySQL相關內容感興趣的讀者可查看本站專題:《MySQL查詢技巧大全》、《MySQL事務操作技巧匯總》、《MySQL存儲過程技巧大全》、《MySQL數(shù)據(jù)庫鎖相關技巧匯總》及《MySQL常用函數(shù)大匯總》