各位高手,帮一下忙,这是一道考试试题,要用SQL语句写出基本表,如下

2025-02-25 13:55:57
推荐回答(1个)
回答1:

这几题的SQL语句如下:
1.
select 姓名 from 职工 where 年龄>45

2.
select 参加.职工号 from 社会团体,参加 where 社会团体.编号=参加.编号 and 社会团体.名称='蓝球队'

3.
select 职工号 from 职工 where not exists(select 1 from 参加 where 参加.职工号=职工.职工号)

4.
select 名称 from 社会团体 order by 名称

5.
select 名称,count(1) as 人数 from 社会团体 group by 名称