create view price_view as
select b.mname as 商场名,a.ino as 商品号,c.iname 商品名 as ,a.price as 价格
from sales a,market b,item c
where a.mno = b.mno and a.ino = c.ino
统计平均售价
select 商品名,avg(价格) as 平均售价 from price_view group by 商品名
1)select distinct 品牌 from 商品表22)select distinct 课程号 from 选课 as T ,选课 as S where T.学生号=@s1 and S.学生号=@s2 and T.课程号 = S.课程号
3)select sum(studnet_ID) from student group by major
4)select max(float) from product_table group by category
5)你自己去想想看吧,之前的我不确定自己做的是不是对的。我也是最近才在学DB
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)