We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Basic Join
- The Report
- Discussions
The Report
The Report
Sort by
recency
|
3552 Discussions
|
Please Login in order to post a comment
What is wrong with my solution?
what is worng with my solution?
SELECT CASE WHEN G.Grade < 8 THEN NULL ELSE S.Name END AS name, G.Grade, S.Marks
FROM Students S JOIN Grades G ON FLOOR(S.Marks/10)+1 = G.Grade ORDER BY G.Grade DESC, CASE WHEN G.Grade >= 8 THEN S.Name ELSE NULL END ASC,
SQL SEVER: SELECT IIF(G.GRADE >= 8, S.NAME, 'NULL'), G.GRADE, S.MARKS FROM STUDENTS S JOIN GRADES G ON (S.MARKS <= G.MAX_MARK) AND (S.MARKS >= G.MIN_MARK) ORDER BY G.GRADE DESC, CASE WHEN G.GRADE >= 8 THEN S.NAME END ASC, CASE WHEN G.GRADE < 8 THEN S.MARKS END ASC
select (Case when g.grade>7 then s.name else null end) Name, g.grade Grade, s.marks Marks from students s left join grades g on (s.marks >= g.min_mark and s.marks <= g.max_mark) order by Grade Desc, Name, marks;