(1)寫(xiě)出建立該表的sql語(yǔ)句
(2)找出nickname為qq的用戶,按id降序排列的sql語(yǔ)句
(3)寫(xiě)出刪除id為1234用戶記錄的sql語(yǔ)句
(4)寫(xiě)出添加id為5555,nickname為’1234′的sql語(yǔ)句
答案:
(1)CREATE TABLE tableqq(

id int not null,
nickname char(20) not null)
(2)SELECT * FROM tableqq WHERE nickname = 'qq' ORDER BY id DESC
(3)DELETE FROM tableqq WHERE id = 1234
(4)INSERT INTO tableqq VALUES(5555,'1234')

2. 有關(guān)系 s(sno,sname) c(cno,cname) sc(sno,cno,grade)
1 問(wèn)上課程 “db”的學(xué)生
select s1.sname from s s1,c c1,sc sc1 where s1.sno = sc1.sno and sc1.cno = c1.cno and c1.cname = 'db'
2 成績(jī)最高的學(xué)生號(hào)
select sno,max(grade) from sc group by sno
3 每科大于90分的人數(shù)
select cno,count(sno) from sc where grade > 90 group by cno;