小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

SQL簡(jiǎn)單查詢(xún)

 杜橋伊人 2020-05-05

1、查詢(xún)教師所有的單位即不重復(fù)的Depart列

select distinct depart from teacher

2、查詢(xún)Score表中成績(jī)?cè)?0到80之間的所有記錄

select * from score where degree between 60 and 80

3、查詢(xún)Score表中成績(jī)?yōu)?5,86或88的記錄

select * from score where degree in (85,86,88)

4、查詢(xún)Student表中“95031”班或性別為“女”的同學(xué)記錄

select * from student where class='95031' or ssex ='女'

5、以Cno升序、Degree降序查詢(xún)Score表的所有記錄

select * from score order by cno,degree desc

6、查詢(xún)“95031”班的學(xué)生人數(shù)

select count(*) from student where class='95031'

或者:select count(*) as scount from student where class='95031'  

---查詢(xún)結(jié)果另取列名 為scount 展示

7、查詢(xún)Score表中的最高分的學(xué)生學(xué)號(hào)和課程號(hào)

select sno,cno from score where degree=(select max(degree) from score) 

8、查詢(xún)每門(mén)課的平均成績(jī)

select cno,avg(degree) from score group by cno

9、查詢(xún)Score表中至少有5名學(xué)生選修的并以3開(kāi)頭的課程的平均分?jǐn)?shù)

select cno,avg(degree) from score group by cno having count(*)>=5 and cno like'3%'

10、查詢(xún)所有學(xué)生的Sname、Cno和Degree列

select sname,cno,degree from student,score

where student.sno=score.sno

或者:select sname,cno,degree from score join student on score.sno = student.sno

11、查詢(xún)所有學(xué)生的Sname、Cname和Degree列

select sname,cname,degree from student,course,score where student.sno = score.sno and score.cno=course.cno

或者:select sname,cname,degree from score join student on student.sno=score.sno join course on score.cno = course.cno

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶(hù) 評(píng)論公約

    類(lèi)似文章 更多