1.班级表 2.学生表 3.student(学生表),Score(成绩表),course(课程表) 4.三张表联合查询 5.连接连个结果集(两个集合必须有相同的列数,列具有相同的数据类型,最终输出的集合的列名第一集合的列名来确定 6.不去除重复(union all) select * from student union all select * from student 7.子查询(在一个查询中,有另外一查询,这个查询就叫做主查询的子查些) 8.Distinct去除重复数据
下面这个是题目所用到的数据库! 首先你需要在你的SQL Sever数据库中创建[TestDb]这个数据库,接下来下面这个代码.直接复制在数据库里运行就好了! 1 USE [TestDb] 2 GO 3 /****** Object: Table [dbo].[Course] Script Date: 2018/4/28 17:36:10 ******/ 4 SET ANSI_NULLS ON 5 GO 6 SET QUOTED_IDENTIFIER ON 7 GO 8 SET ANSI_PADD
step1:在mysql cmd中新建存储过程: drop procedure if exists queryCountByGrade ; delimiter // -- 定义存储过程结束符号为// create procedure queryCountByGrade(IN gradenameinput INT(),OUT counts ) begin select count(*) into counts from student where grade = gradenameinput;en