37 lines
1.0 KiB
SQL
37 lines
1.0 KiB
SQL
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# 2.查询所有学生信息,并根据年龄进行降序排序。(10分)
|
||
SELECT * FROM student ORDER BY age DESC
|
||
# 3.显示姓王的学生的详细信息。(10分)
|
||
SELECT * FROM student where INSTR(student.ename,'王')
|
||
#4.查询工资大于5000的所有男同学的信息。(10分)
|
||
|
||
SELECT * FROM student where student.sal>5000 and student.sex='男'
|
||
|
||
# 5.查询班级编号为20的男同学的电话号码。(10分)
|
||
SELECT student.tel FROM student WHERE student.classid=20
|
||
|
||
# 6.查询最低工资。(10分)
|
||
SELECT student.sal FROM student ORDER BY student.sal ASC LIMIT 1
|
||
|
||
|
||
# 7.查询班级为30的学生的最小年龄。(10分)
|
||
|
||
SELECT student.age FROM student WHERE student.classid=30 ORDER BY student.age ASC LIMIT 1
|
||
|
||
|
||
# 8.查询女生的最低工资。(15分)
|
||
SELECT student.sal FROM student WHERE student.sex='女' ORDER BY student.sal ASC LIMIT 1
|
||
|
||
# 9.查询女学生中薪资最低的人的全部信息。(15分)
|
||
SELECT * FROM student WHERE student.sex='女' ORDER BY student.sal ASC LIMIT 1
|
||
|
||
|
||
|