Ⅰ 怎麼用sql語句查找學生的成績排名
工具/材料:以Management Studio為例。
1、首先在桌面上,點擊「Management Studio」圖標。
Ⅱ 試寫一個SQL語句,查詢出各科成績最高分的同學(包括學生號,科目與成績)
select top 10 學生號列,成績列,科目列 from 表 where 科目列=科目 order by id desc,成績 desc
某個科目的前面最高分的10位同學
以此類推.要查哪個科目就改下科目就行了
Ⅲ SQL查詢單科成績最高的同學
SELECT child.abc,child.cource,a.name
FROM (select max(b.point) as abc,c.cource from `student` as a join `achievement` as b join `course` as c on a.sex = 1 and b.sid=a.id and b.cid=c.id group by c.cource) as child
join `student` as a join `achievement` as b join `course` as c on a.sex = 1 and b.sid=a.id and b.cid=c.id where child.abc=b.point and child.cource=c.cource
很繁瑣,子查詢和查詢的都是同一個表同一個條件,答案包對
不要姓名要學號的話就把名字換一下
原理
子查詢出最高分和科目,再用父查詢把(同條件下)把最高分和科目配對
Ⅳ 請根據要求寫出相應的sql語句:查詢score表中,語文成績的最高分
可以使用以下 SQL 語句來查詢 score 表中語文成績的最高分:
SELECT MAX(chinese) FROM score;
在這個 SQL 語句中,我們使用了 MAX 函數來查詢 chinese 列中的最高分。
你可能需要根據自己的情況來修改表名和列名,以適應你的資料庫結構。
Ⅳ sql語句查詢成績最高的學生
select * from 學生表 where 學生id in (select 學生id from 分數表 where 分數值 = (select Max(分數欄位) from 分數表)),這樣查詢即可。
Ⅵ 用SQL選出每個人成績的最高紀錄
查詢每個人最高成績SQL:
第一種:先使用group by和max得到最高分數和學科,然後再查詢一下score表,找到學科和分數都相同的記錄
select b.* from (select max(score) t,course from score group by course) a,score b where a.t=b.score and a.course=b.course
第二種:先得到相同學科的最高分數,再查詢score表,找到最高分數的記錄select * from score a where score=(select max(score) from score where course=a.course)
第三種:score表中,當學科一樣的時候,不存在一條記錄的分數小於其它記錄的分數select * from score a where not exists(select * from score where a.course=course and a.score<score)
Ⅶ SQL語句查詢每個學生的學號、姓名、平均成績、最高成績和最低成績
select 學生表.學號,學生表.姓名,
average(成績表.成績) as 平均成績,
max(成績表.成績) as 最高成績,
min(成績表.成績) as 最低成績
from 學生表 left join 成績表 on 學生表.學號=成績表.學號
order by 學生表.學號
成績表可換成語文、數學、英語等,查詢結果就是各個學生相應課程的平均成績、歷史最高成績、歷史最低成績.
Ⅷ sql查詢最高分和最低分
//查詢最高分
selectmax(score)fromstudent
//查詢最低分www.sz886.com
selectmin(score)fromstudent
//查詢最低分和最高分
selectmin(score)asmin_score,max(score)asmax_scorefromstudent
Ⅸ 4、有一張表Performance,有欄位name.score,請用sql語句如何查詢出分數最高的
SELECT name, score, dense_rank(ORDER BY score)FROM A