一道简单的SQL,求高手
if object_id('S') is not nulldrop table S
go
create table S(S# nvarchar(50),SN nvarchar(100),SD nvarchar(100),SA int)
insert S select 'V001',N'小明',N'第二班',25
union all select 'V002',N'小日',N'第三班',28
union all select 'V003',N'小月',N'第一班',26
union all select 'V004',N'小萌',N'第四班',21
union all select 'V005',N'小a',N'第a班',21
go
if object_id('C') is not null
drop table C
go
create table C(C# nvarchar(50),CN nvarchar(100))
insert C select 'C001',N'英语课'
union all select 'C002',N'数学课'
union all select 'C003',N'税收基础'
union all select 'C004',N'化学课'
go
if object_id('SC') is not null
drop table SC
go
create table SC(S# nvarchar(50),C# nvarchar(50),G int)
insert SC select 'V001','C002',95
union all select 'V002','C004',45
union all select 'V001','C003',84
union all select 'V003','C002',65
union all select 'V003','C001',75
union all select 'V004','C001',55
union all select 'V004','C002',55
union all select 'V004','C003',55
union all select 'V004','C004',55
go
select * from S
select * from C
select * from SC
--查询选修全部课程的学员姓名和所属单位
\我也想了很久,但就是不知道如何下手,高手能把你做这道的是如何想,简单给我说一说,主要是做题的思路,