实训11
七
方法一:
selectc_no,count(s_no),max(sc_sco)
from sc
where c_no in
(select c_no
from course
where c_name<>'PB程序设计')
group by c_no;
方法二:
selectc_no,count(s_no),max(sc_sco)
from sc
group by c_no
having c_no in
(select c_no
from course
where c_name<>'PB程序设计');
八
use xxgl;
insert into student
values ('000000','张三','男','1999-1-1','17计算机1班','信息','计算机应用技术','123456789')
insert into course
values('109','MySQL程序设计','《MySQL数据库应用》',4,'106');
insert into sc
values(null, '000000', '109',60);
九
use xxgl;
update sc
set sc_sco=null
where s_no='000000';
select * from sc where s_no='000000';
十
use xxgl;
delete from sc
where c_no in
(select c_no
from course
where c_name='计算机原理');
序号列重新编号
desc sc;
alter table sc drop sc_no;
alter table sc
add sc_no int auto_increment primary key first;
select * from sc;
赞 (0)