r
题10:r
查询全体学生的姓名和出生年份,比在出生年份列前加入一个列,此列的每行数据均为“YearofBirth”常量值。r
答案:r
selects
ameYearofBirthto_charsysdateYYYYsagefromstude
tr
r
r
题11:r
在选课表(SC)中查询有哪些学生选修了课程,并列出学生的学号。r
答案:r
selectdisti
cts
ofromscr
r
r
题12:r
查询计算机系全体学生的姓名。r
答案:r
selectdisti
cts
amefromstude
twheresdept计算机系r
r
r
题13:r
查询所有年龄在20岁以下的学生的姓名及年龄。r
答案:r
selects
amesagefromstude
twheresage20r
r
r
题14:r
查询考试成绩不及格的学生的学号。r
答案:r
selectdisti
cts
ofromscwheregrade60r
r
r
题15:r
查询年龄在2023岁之间的学生的姓名,所在系和年龄。r
答案:r
selects
amesdeptsagefromstude
twheresage20a
dsage23r
r
r
题16:r
查询年龄不在2023之间的学生的姓名,所在系和年龄。r
答案:r
selects
amesdeptsagefromstude
twheresage20orsage23r
r
r
题17:r
查询信息系,数学系和计算机系学生的姓名和性别。r
答案:r
selects
amessexfromstude
twheresdeptIN‘信息系’‘数学系’‘计算机系’r
r
r
题18:r
查询既不属于信息系,数学系,也不属于计算机系的学生的姓名和性别。r
答案:r
selects
amessexfromstude
twheresdept
oti
信息系数学系数学系r
r
r
题19:r
查询姓“张”的学生的详细信息。r
答案:r
selectfromstude
twheres
amelike‘张’r
r
r
题20:r
查询学生表中姓“张”,姓“李”和姓“刘”的学生的情况。r
答案:r
selectfromstude
twheres
amelike张ors
amelike李ors
amelike刘r
或者r
selectfromstude
twheres
amelike张李刘r
r
r
题21:r
查询名字中第2个字为“小”或“大”字的学生的姓名和学号。r
答案:r
selects
ames
ofromstude
twheres
amelike_小ors
amelike_大r
或者r
selects
ames
ofromstude
twheres
amelike_小大r
r
r
题22:r
查询所有不姓“刘”的学生。r
答案:r
selectfromstude
twheres
ame
otlike刘r
r
r
题23:r
从学生表中查询学号的最后一位不是2,3,5的学生的情况。r
答案:r
selectfromstude
twheres
o
otlike2a
ds
o
otlike3a
ds
o
otlike5r
或者r
selectfromstude
twheres
o
otlike235r
r
r
题24:r
查询无考试成绩的学生的学号和相应的课程号。r
答案:r
selects
oc
ofromscwheregradeis
ullr
r
r
题25:r
查询所有有考试成绩的学生的学号和课程号。r
答案:r
selects
oc
ofromscwheregradeis
ot
ullr
r
r
题26:r
查询计算机系年龄在20岁以下的学生的姓名。r
答案:r
selects
amefromstude
twheresdept计算机系a
dsage20r
r
r