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

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在线网站| 91欧美日韩在线观看视频| 精品久久久久久久久无| 成人av在线免费播放| 日韩成人在线视频观看| 中文字幕乱码日韩一二三区| 久久视频在线播放视频| 国产亚洲欧美精品久久久久久| jvid视频在线观看免费| 日韩av不卡免费播放| 日韩国产欧美亚州精品| 亚洲欧美日韩精品av| 亚洲国产精品久久久久久99| 熟女精品国产一区二区三区 | 九九视频在线精品免费观看| 日本免费一区二区三个| 久久精品免成人费电影| 91精品国语对白人妻刺激| 亚洲日本中文字幕免费观看| 中文字幕日韩乱码一级在线| 国产国语久久91老女人| 亚洲精品一区二区三区高潮| 最新亚洲国产高清激情| 91亚洲精品综合久久| 欧美日韩精品人妻中文| 国产美女极度色诱视频| 一区二区蜜桃在线观看| 后入视频国产在线观看| 中文字幕乱码人妻一区二| 黄片视频免费在线播放大全| 亚洲天堂av在线有码| 久久久久四虎国产精品| 国产欧美日韩精品av| 日韩欧美精品在线观看免费| 亚洲天堂男人的天堂狠狠操| 国产成人一区二区三区影| 伊人丁香六月日日操操| 国产成人大片中文字幕在线| 亚洲国产精品激情在线| 欧美亚洲精品一区二区三区|