請問這兩個題的sql語句怎麼寫,這個題的SQL語句怎麼寫?

時間 2022-09-03 13:40:05

1樓:不知光年

1、update 表 set 學號=學號+1 where 學號》=54

insert into 表(學號,姓名) value (54,李四)

2、select * from 表 where 學號 in (select top 10 學號 from 表 where 學科='語文' order by 成績 desc) and 學號 not in (select top 10 學號 from 表 where 學科='數學' order by 成績)

2樓:匿名使用者

第一題tomaj已經回答

第二個問題他好像寫的不對

select 學號,班級,姓名

from 表

where 學科='語文'

and row_number() over (partition by 班級 order by 成績 desc)<=10

minus

select 學號,班級,姓名

from 表

where 學科='數學'

and row_number() over (partition by 班級 order by 成績)<=10

3樓:蘋果牛奶巧克力雪糕冰淇淋

1,select * from 學員資訊表 ordey by case when 姓名= 李四 then '54' else 學號 end

2,全十名. select top 10 * from表 order by 成績 desc

後十名,全十名. select top 10 * from表 order by 成績 asc

這個題的sql語句怎麼寫?

4樓:匿名使用者

select * from emp where salary >(select max(salary) from emp where id in(select manid from emp group by manid))

資料庫問題,請問這個sql語句怎麼寫

如何寫這道題的sql語句,題目如下:

5樓:匿名使用者

給你個思路

1.把產品表product中的pid欄位提取出來,暫定為表1,用表cp除以表1得到的cid欄位,那就是出口所有產品的國家的cid,再跟表country聯絡一下,就能得到這些國家的名字

2.select a.cid

from country a

where a.cid not in (select c.cidfrom cp c);

6樓:匿名使用者

sql2005測試結果

1.select * from countrywhere cid in

(select tba.cid

from

(select

cid ,count(pid) as 'shuliang'

from cp

group by cid) tba,

(select count(*) as 'p_shuliang'

from product) tbb

where tba.shuliang=tbb.p_shuliang)2.select * from countrywhere cid in

(select

tba.cid

from

(select a.cid,a.cname,b.pidfrom country a

left join

cp b

on a.cid=b.cid) tba

where tba.pid is null)

7樓:匿名使用者

1.select a.cid from (select cid,count(1) as pcount from cp group by cid) a,(select count(1) as pcount2 from product group by pid) b

where a.pcount=b.pcount2

2.select * from country where not exists(select 1 from cp where cp.cid=country.cid)

8樓:妮妮爸爸

huzi01245 正解

思路應該是正解的,但是具體sql語句估計有問題..應該要分組cp來count吧

9樓:匿名使用者

1:select * from country where cid in(select cid from cp where count(cid)=(select count(cip) from produc) group by cid)

2:select * from country where cid in(select cid from cp where count(cid)=0)

這幾個sql語句面試題該怎麼寫

10樓:穎兒很乖

我也不知道 哈哈哈,因為這是我沒上過

請問這兩個名字日文怎麼讀,請問這兩個字怎麼讀?

鍾嘉輝 syou ka ki 孝展 kou ten 或者 kyou ten 剛上日本的 查到 鬆橋孝展.的發音是 matsuhashi takashi 很可能 孝展 就是 takashi 雖然這個日本名字的兩個漢字都沒有訓讀 在現代日語詞典裡 一般來說這名字只有上面兩個發音。但是日本人取名的時候,有...

請問這兩個圓圓是什麼牌子的包,請問這兩個圓圓是什麼牌子的包 20

你確定這個不是模仿香奈兒的嗎? 我知道4個圓圈是什麼牌子?兩個圓圈交叉是什麼品牌包包標誌 闆捐崏餜拫 不是gucci,是ohanel。gucci是兩個g 請問這是什麼牌子的包? 科易網 註冊商標圖示商標,是識別某商品 服務或與其相關具體個人或企業的顯著標志。圖形 常用來表示某個商標經過註冊,並受法律...

請問這兩個可以解除安裝嗎,請問這兩個電腦配置哪個好點

騰訊電腦管家 第一個是vc 執行庫,如果刪除很可能有些遊戲或者軟體無法使用,到時候還需要重新安裝。下面的是音效卡驅動程式,如果解除安裝掉了就會沒有聲音了。這兩個還是留著吧。請問這兩個電腦配置哪個好點 請問這兩個檔案是系統自帶的,還是病毒? 可以刪除 不是系統資料夾 北京瑞星資訊科技股份 應該安裝系統...