一、分享背景:
由于最近测试这个行业,内卷的非常严重,不得不再得好好的学习一下,测试周边的一些知识,今天为大家整理一些数据库经典的笔试题,可以好好的备战一下测试在数据库方面的知识。
二、分享内容:
1.1 本题目的表结构 Student(S#,Sname,Sage,Ssex)学生表 Course(C#,Cname,T#)课程表 SC(S#,C#,score)成绩表 Teacher(T#,Tname)教师表 1.2本题目的建表及测试数据 1建表 create table Student( S# int, Sname varchar(32), Sage int, Ssex varchar(8) ) create table Course( C# int , Cname varchar(32), T# int ) create table Sc( S# int , C# int , score int , ) create table Teacher( T# int , Tname varchar(32) ) (1)查询“001”课程比002课程成绩高的所有学生的学号;
select a.S# from 2 (select S#,Score from SC where C#='001') a, 3 (select S#,Score from SC where C#='002') b 4 where a.S#=b.S# and a.Sco |