select SNAME,CITY from S where SNO='S1';
select PNO from P where COLOR = '红';
select JNAME from J where CITY='天津';
select SNO from SPJ where JNO='J1' and PNO = 'P1';
select SNAME,SNO,Lower(SNO) sno from S;
select distinct SNO from SPJ ;
select s.SNAME,s.CITY from SPJ spj,S s where spj.SNO=s.SNO order by s.CITY asc,s.SNAME desc;
select JNO from SPJ where SNO='S1' order by JNO asc;
select COUNT(PNO) from SPJ;
select PNO,PNAME,COLOR from P where PNAME like '螺%';
select s.SNAME,COUNT(sj.PNO) from SPJ sj,S s where PNO='P3' and s.SNO = sj.SNO group by s.SNAME;
select distinct SNO from SPJ where PNO IN(select PNO from P where COLOR='红')
select distinct PNO from SPJ where SNO IN(select SNO from S where CITY='上海')
select JNAME from J where JNO IN(
select JNO from SPJ where SNO IN(
select SNO from S where CITY='上海'
)
)
select distinct JNO from SPJ where SNO not IN (select SNO from S where CITY='天津')
select distinct JNO from SPJ where SNO not IN(select SNO from S where CITY='天津')
AND PNO IN(select PNO from P where COLOR='红')
select distinct JNO from SPJ where SNO IN(select SNO from SPJ where SNO='S1')
select distinct JNO from SPJ where SNO IN(select SNO from SPJ where SNO='S1')