USE Homework250324;
Go
-- 创建三建工程项目的供应情况视图，包括SNO, PNO, QTY
CREATE VIEW view_sanjian as select sno, pno, qty FROM j, spj where j.jno = spj.jno and j.jname = N'三建';
Go
-- 找出三建工程项目使用的各种零件代码及其数量
SELECT pno, sum(qty) from view_sanjian group by pno;
Go
-- 找出供应商S1的供应情况
select * from view_sanjian where sno = 'S1';
Go