共回答了16个问题采纳率:93.8%
用MySQL测试通过,尽量写标准SQL,如果是其他数据库,应该可以通过或稍加修改即可通过.
13.
select t2.sname from sp t1
left join s as t2 on t1.sno=t2.sno
left join p t3 on t1.pno=t3.pno
where t3.color='red'
group by t2.sname
14. select sno,sname,status from s where city='BJ'
15.
select sum(t1.qty) from sp t1
left join p t2 on t1.pno=t2.pno
where t2.pname='p2'
16. update p set weight=100 where pname='p2'
17. update p set color='yellow' where pname='p2'
18.
select t2.sn from spj t1
left join s t2 on t1.sno=t2.sno
left join p t3 on t1.pno=t3.pno
left join j t4 on t1.jno=t4.jno
where t3.color='red' and t4.jn='j1'
group by t2.sno
19.
select t2.jn