SQL query - Help me

CREATE TABLE CLASS(
CLASS nvarchar(50)
);
CREATE TABLE STUDENT(
ID int,
NAME nvarchar(50),
CLASS nvarchar(50),
SEX nvarchar(10),
BIRTHDAY int
);
CREATE TABLE BANGDIEM(
NAME nvarchar(50),
SUBJECT nvarchar(50),
SCORE decimal)

QUERY:Get the student with the 2nd highest score in the database subject of each class?

Just posting a homework problem is not appropriate. Try it first and show what you tried. Then if you get stuck someone may wish to help. I might also note that having most fields as character is poor design.

1 Like