欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Java面試中出現(xiàn)率極高的數(shù)據(jù)庫查詢題有哪些

這篇文章將為大家詳細(xì)講解有關(guān)Java面試中出現(xiàn)率極高的數(shù)據(jù)庫查詢題有哪些,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

十多年的駐馬店網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。成都全網(wǎng)營銷推廣的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整駐馬店建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)建站從事“駐馬店網(wǎng)站設(shè)計(jì)”,“駐馬店網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

基本表結(jié)構(gòu):

teacher(tno,tname) 教師表

student(sno,sname,sage,ssex)學(xué)生表

course(cno,cname,tno) 課程表

sc(sno,cno,score) 成績表

NO.1查詢課程1的成績比課程2的成績高的所有學(xué)生的學(xué)號(hào)

select a.sno from(select sno,score from sc where cno=1) a,(select sno,score from sc where cno=2) bwhere a.score>b.score and a.sno=b.sno

NO.2查詢平均成績大于60分的同學(xué)的學(xué)號(hào)和平均成績

select a.sno as "學(xué)號(hào)", avg(a.score) as "平均成績" from(select sno,score from sc) a group by sno having avg(a.score)>60

NO.2查詢所有同學(xué)的學(xué)號(hào)、姓名、選課數(shù)、總成績

select a.sno as 學(xué)號(hào), b.sname as 姓名,count(a.cno) as 選課數(shù), sum(a.score) as 總成績from sc a, student bwhere a.sno = b.snogroup by a.sno, b.sname

或者:

selectstudent.sno as 學(xué)號(hào), student.sname as 姓名, count(sc.cno) as 選課數(shù), sum(score) as 總成績from student left Outer join sc on student.sno = sc.snogroup by student.sno, sname

NO.3查詢姓“張”的老師的個(gè)數(shù)

selectcount(distinct(tname)) from teacher where tname like '張%‘

或者:

select tname as "姓名", count(distinct(tname)) as "人數(shù)" from teacher where tname like'張%'group by tname

NO.4查詢沒學(xué)過“張三”老師課的同學(xué)的學(xué)號(hào)、姓名

select student.sno,student.sname from student
where sno not in (select distinct(sc.sno) from sc,course,teacher
where sc.cno=course.cno and teacher.tno=course.tno and teacher.tname='張三')

NO.5查詢同時(shí)學(xué)過課程1和課程2的同學(xué)的學(xué)號(hào)、姓名

select sno, sname from studentwhere sno in (select sno from sc where sc.cno = 1)and sno in (select sno from sc where sc.cno = 2)

或者:

selectc.sno, c.sname from(select sno from sc where sc.cno = 1) a,(select sno from sc where sc.cno = 2) b,student cwhere a.sno = b.sno and a.sno = c.sno

或者:

select student.sno,student.sname from student,sc where student.sno=sc.sno and sc.cno=1and exists( select * from sc as sc_2 where sc_2.sno=sc.sno and sc_2.cno=2)

NO.6查詢學(xué)過“李四”老師所教所有課程的所有同學(xué)的學(xué)號(hào)、姓名

select a.sno, a.sname from student a, sc bwhere a.sno = b.sno and b.cno in(select c.cno from course c, teacher d where c.tno = d.tno and d.tname = '李四')

或者:

select a.sno, a.sname from student a, sc b,(select c.cno from course c, teacher d where c.tno = d.tno and d.tname = '李四') ewhere a.sno = b.sno and b.cno = e.cno

NO.7查詢課程編號(hào)1的成績比課程編號(hào)2的成績高的所有同學(xué)的學(xué)號(hào)、姓名

select a.sno, a.sname from student a,

(select sno, score from sc where cno = 1) b,

(select sno, score from sc where cno = 2) c

where b.score > c.score and b.sno = c.sno and a.sno = b.sno

NO.8查詢所有課程成績小于60分的同學(xué)的學(xué)號(hào)、姓名

select sno,sname from studentwhere sno not in (select distinct sno from sc where score > 60)

NO.9查詢至少有一門課程與學(xué)號(hào)為1的同學(xué)所學(xué)課程相同的同學(xué)的學(xué)號(hào)和姓名

select distinct a.sno, a.snamefrom student a, sc bwhere a.sno <> 1 and a.sno=b.sno andb.cno in (select cno from sc where sno = 1)

或者:

select s.sno,s.sname from student s,(select sc.sno from scwhere sc.cno in (select sc1.cno from sc sc1 where sc1.sno=1)and sc.sno<>1group by sc.sno)r1where r1.sno=s.sno

關(guān)于Java面試中出現(xiàn)率極高的數(shù)據(jù)庫查詢題有哪些就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。

本文題目:Java面試中出現(xiàn)率極高的數(shù)據(jù)庫查詢題有哪些
網(wǎng)站鏈接:http://aaarwkj.com/article12/igepdc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)、網(wǎng)頁設(shè)計(jì)公司、全網(wǎng)營銷推廣、移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司
亚洲欧美另类重口国产| 午夜激情视频在线网站| 亚洲精品一二三区免费| 国产高跟丝袜av专区| 能在线播放的国产三级| 国产午夜亚洲精品福利| 日本激情人妻一区二区| 久久精品国产亚洲七七| 丰满熟妇久久人妻同堂av| 精品在线免费视频观看| 色噜噜色一区二区三区| 欧美亚洲国产精品久久久| 中文字幕一区二区中文字幕| 少妇欧美日韩精品在线观看| 深夜释放自己污在线看| 国内不卡一区二区三区| 啊啊舒服爽用力爱我视频| 国产内射一级一片内射高清视频1| 背德人妻中文字幕无修| 日本一区二区三区播放| 国产精品福利手机在线观看| 人人妻人人澡人人爽人人dvd| 色综合色综合色综合色| 性色av人妻中文一区二区| 新人妻一区二区在线视频| 国产精品国产三级丝袜| 在线观看亚洲av日韩av| 亚洲天堂,男人的天堂| 在线观看日韩精品电影| 91在线免费观看国产精品| 青青草原成年人免费看| 粉嫩av一男战三女高潮| 亚洲欧美午夜激情啪啪视频| 欧美亚洲国语精品一区二区| 中文字幕乱码人妻一区| 亚洲av正片一区二区三区| 日本欧美一区二区二区视频免费 | 欧美大片免费久久精品| 日本少妇人妻一区二区| 久久久久久亚洲精品少妇| 涩久久悠悠一区二区三区|