Which Transact-SQL query should you use?

You create a table that has three columns named StudentCode, SubjectCode, and Marks. The Marks column records grades for students expressed as a percentage. The table has marks obtained by 50 students for various subjects.
You need to retrieve the StudentCode and Marks for students who scored the highest percentage for each subject.
Which Transact-SQL query should you use?
A.

B.

C.

D.

E.

F.

G.

H.

microsoft-exams

2 thoughts on “Which Transact-SQL query should you use?

  1. I agree with F – Marks in DESC order = highest % first.
    G in ASC order with lowest first – wrong.

    BTW Lois, F and H are not the same. F is PARTITION BY SubjectCode (as requested). H is PARTITION BY StudentCode – not right.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.