drop database if exists jxgl;
create database jxgl;
use jxgl;
drop table if exists student;
create table student
(sno char(20) primary key, sname varchar(20), sage int(20), ssex char(20), sdept char(20));
insert into student value ('2005001','钱横',18,'男','Cs');
insert into student value ('2005002','王林',19,'女','Cs');
insert into student value ('2005003','李民',20,'男','Is');
insert into student value ('2005004','赵欣然',16,'女','Ma');
insert into student value ('2005005','陈家国',20,'男','Ca');
insert into student value ('2005006','陈以为',21,'男','Ma');
insert into student value ('2005007','陈丙',22,'女','Cs');
insert into student value ('2005008','陈丁',22,'男','Da');
insert into student value ('2005009','陈式',18,'女','Ma');
insert into student value ('2005010','陈看',19,'女','Df');
insert into student value ('2005020','陈助',25,'女','Me');
drop table if exists course;
create table course
(cno int(10),cname varchar(20),cpno int(10),ccredit int(10),primary key(cno));
insert into course value (1,'数据库系统 ',5,4);
insert into course (cno,cname,ccredit) value (2,'数学分析',2);
insert into course value (3,'信息系统导论',1,3);
insert into course value (4,'操作系统原理',6,3);
insert into course value (5,'数据结构',7,4);
insert into course value (6,'数据处理基础',Null,4);
insert into course value (7,'C语言',6,3);
insert into course value (8,'大学语文',1,2);
insert into course value (9,'高等数学',2,2);
insert into course value (10,'程序设计',3,3);
insert into course value (11,'信号系统',4,4);
insert into course value (12,'通信原理',5,4);
insert into course value (13,'计算机组成原理',6,2);
i
mysql-select查询操作
最新推荐文章于 2023-03-17 12:28:59 发布
本文介绍了在MySQL中使用SELECT语句进行各种复杂查询的操作,包括统计选修课程门数、计算特定课程学生平均年龄、查找学分为3的课程学生平均成绩、筛选选修人数超3人的课程、找出学号年龄条件的学生、查询姓名以特定字符开头的学生、查找成绩为空的学生、对比男女平均年龄的学生以及找出年龄超过所有女生的男生,并展示了查询多门课程总成绩的方法。
摘要由CSDN通过智能技术生成