数据库中创建视图要关联3个表,怎么写SQL语句?

2024-11-28 00:08:26
推荐回答(2个)
回答1:

视图D的创建:
create view 表D
as
SELECT dbo.表A.姓名 as 姓名, dbo.表B.图书名称 as 图书名称, dbo.表C.学号 as 学号
FROM dbo.表A CROSS JOIN
dbo.表B CROSS JOIN
dbo.表C

希望是你需要的!

回答2:

create view view1
as
select A.学号,姓名,图书名称
from A join C on A.学号=C.学号 join B on C.书号=B.书号
with check option
go