5 Tricky SQL Queries Solved -- Part II
Given a table of students and their GRE test scores, write a query to return the two students with the closest test scores and their score difference. If there exists more than one pair, sort their names in ascending order and then return the first resulting pair. This requires some creative thinking in SQL. Since there is only one table with two columns we need to self-reference different creations of the same table. We can solve these kinds of problems by visualizing two tables having the same values.
Nov-25-2020, 18:15:41 GMT
- Technology:
- Information Technology
- Databases (0.40)
- Artificial Intelligence (0.40)
- Information Technology