1.查询01课程比02课程成绩高的学生的信息及课程分数 #1.1查询01课程与02课程的课程表: select student_id, score as c1_score from score where course_id='01'; select student_id, score as c2_score from score where course_id='02'; #1.2使用内连接,将两个课程表进行连接,并从中选出01 select c1.student_id,c1_score,c2…
mysql第四篇:数据操作之多表查询 一.多表联合查询 #创建部门 CREATE TABLE IF NOT EXISTS dept ( did int not null auto_increment PRIMARY KEY, dname VARCHAR() not null COMMENT '部门名称' )ENGINE=INNODB DEFAULT charset utf8; #添加部门数据 INSERT INTO `dept` VALUES (', '教学部'); INSERT INTO `d…