1.查询省内所有城市气温都大于35度的省份(表名:Temp)

两道SQL题目-LMLPHP

SELECT
province
FROM
Temp
WHERE
province NOT IN (
SELECT
province
FROM
Temp
WHERE
temper <= 35
GROUP BY
province
)
GROUP BY
province

2、查询所有课程分数都大于85分的学生姓名

两道SQL题目-LMLPHP

SELECT
NAME
FROM
Student s
WHERE
NOT EXISTS (
SELECT
*
FROM
Exam e
WHERE
s.person_id = e.person_id
AND e.score < 84
)
05-08 08:37