SQL25、查找山东大学或者性别为男生的信息
思路:由于有排序需要,所以要使用UNION ALL
关键字将数据连接起来
代码解释:分别求出山东大学的用户数据和男性的用户数据,然后将它们连接起来
SELECT
device_id,
gender,
age,
gpa
FROM
user_profile
WHERE
university = '山东大学'
UNION ALL
SELECT
device_id,
gender,
age,
gpa
FROM
user_profile
WHERE
gender = 'male'