zoukankan      html  css  js  c++  java
  • SQL练习题

    5.

    表中的数据已提前插入

    use SPJ;
    (1)select SNAME, CITY from St;
    (2)select PNAME, COLOR, WEIGHT from P;
    (3)select PNO from SPJ where SNO = 'S1';
    (4)select PNAME, QTY from P, SPJ where SPJ.JNO = 'J2' and SPJ.PNO = P.PNO;
    select * from St;
    select * from SPJ;
    select * from P;
    update St set SNO = 'S4' where SNAME = '丰盛泰';
    (5)select PNO from SPJ, St where SPJ.SNO = St.SNO and St.CITY = '上海';
    select PNO from SPJ where SPJ.SNO in (select SNO from St where CITY = '上海'); //同上
    (6)select distinct JNAME from J where JNO in (select JNO from SPJ where SNO in(select SNO from St where CITY = '上海'));
    select distinct J.JNAME from J, SPJ, St where J.JNO = SPJ.JNO and SPJ.SNO = St.SNO and St.CITY = '上海';//同上
    (7)select JNO from SPJ, St where St.SNO = SPJ.SNO and St.CITY = '天津'; //不会用这种表示
    //select distinct JNO from SPJ where SNO not in (select SNO from St where CITY = '天津');
    (8)update P set COLOR = '蓝' where COLOR = '红';
    (9)update SPJ set SNO = 'S3'where SNO = 'S5' and PNO = 'P6' and JNO = 'J4';
    (10)delete * from St where SNO = 'S2';
    (10)delete * from SPJ where SNO = 'S2';
    (11)insert into SPJ values('S2','J6','P4',200);

    9.(1)
    create view SJ as select SNO, PNO, QTY from J, SPJ where J.JNO = SPJ.JNO and J.JNAME = '三建';
    select distinct * from SJ where SNO = 'S1';

  • 相关阅读:
    java关键字-static
    java内部类
    绘制椭圆
    画出一个三角形
    创建和使用画刷
    画刷使用
    绘制矩形
    在getview方法中有三个参数,起到优化的部分为ViewHolder的使用,主要方法setTag(),getTag()
    SecondContract 接口类
    SecondModel 实现类
  • 原文地址:https://www.cnblogs.com/AGoodDay/p/10774039.html
Copyright © 2011-2022 走看看