SQL_實驗1.3 清華大學出版社

來源:互聯網
上載者:User

/*1.*/insertinto studentsvalues('70045678','LiMing','LX@cdemg.com',1992);/*2.*/create table choices_result(cid char(10),students smallint,avgscore smallint);insert into choices_resultselect cid, count(sid), avg(score)from choicesgroup by cid;/*3*/update studentsset grade = '2002'where sname = 'LiMing';
/*4.*/update teachersset salary=salary+500;/*5.*/update choicesset score=score+5where choices.no=(select choices.nofrom choices,courses,studentswhere courses.cid=choices.cid and students.sid = choices.sidand courses.cname = 'c' and students.sname = 'zapyv');/*6.*/delete studentswhere sname = 'LiMing';/*7.*/deletefrom choiceswhere 'java' = (select cnamefrom courseswhere courses.cid = choices.cid);/*8.*/deletefrom choiceswhere choices.cid in(select courses.cidfrom courseswhere courses.hour < 48);delete courseswhere hour < 48;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.