****你的供应商中没有SEX(性别)这个选项,我帮你加入了****
建立基本表
供应商 S(SNO,SNAME,AGE,SADDR,sex)主键:SNO
产品 P (PNO,PNAME,COLOR,WEIGHT) 主键:PNO
供应 SP(SNO,PNO,QTY) 主键:SNO,PNO
1.select PNAME from P where PNO in (select PNO from SP where SNO in (select SNO from S where SADDR="PAIRS"))
2.select SNAME,AGE from S where sex='女' and SADDR="BEIJING"
3.select sno,pno from sp where qty>(select avg(qty) from sp)
4.delete from SP where PNO in(select PNO from P where PNAME="TV")
5.select avg(age) as A ,saddr from s where not exists (select avg(age)as B from s where B>A group by saddr)group by saddr
6.update SP set QTY=QTY*95% where PNO in (select PNO from P where PNAME="CAR")