SQL 这个题怎么做?
a)selectavg(price),typefrombookgroupbytypeB)a)selectavg(price),typefrombookgroupbypri...
a)select avg(price),type from book group by type
B)a)select avg(price),type from book group by price
为什么? 展开
B)a)select avg(price),type from book group by price
为什么? 展开
1个回答
展开全部
有问题联系我2511837361
--1
select couno,couname from course
where course not in('004','007','013')
--2
select student.stuno,student.stuname from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
--3
select avg(COUNT(student.stuno)) from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
group by kind
--4
select classno,student.stuno,student.stuname,couname,tracher,schooltime from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
inner join class on student.classno=class.classno
where classname='01电子商务'
--5
update course set schooltime='周二晚' from course
inner join stucou on course.cnuno=stucou.cnuno
inner join student on student.stuno=stucou.stuno
inner join class on class.classno=student.classno
where classname='01电子商务'
--6
alter table stucou
add constraint For_stuno foreign key(stuno) references student(stuno)
--7
create view myview
as
select MIN(COUNT(stuno)),MAX(MIN(COUNT(stuno))),AVG(MIN(COUNT(stuno)))
from student inner join class on student.classno=class.classno group by classno
--1
select couno,couname from course
where course not in('004','007','013')
--2
select student.stuno,student.stuname from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
--3
select avg(COUNT(student.stuno)) from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
group by kind
--4
select classno,student.stuno,student.stuname,couname,tracher,schooltime from student
inner join stucou on student.stuno=stucou.stuno
inner join course on couse.couno=stucou.couno
inner join class on student.classno=class.classno
where classname='01电子商务'
--5
update course set schooltime='周二晚' from course
inner join stucou on course.cnuno=stucou.cnuno
inner join student on student.stuno=stucou.stuno
inner join class on class.classno=student.classno
where classname='01电子商务'
--6
alter table stucou
add constraint For_stuno foreign key(stuno) references student(stuno)
--7
create view myview
as
select MIN(COUNT(stuno)),MAX(MIN(COUNT(stuno))),AVG(MIN(COUNT(stuno)))
from student inner join class on student.classno=class.classno group by classno
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询