Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, July 18, 2016

SQL: Table Transformation Lesson 5 Sample Solution


Instruction:
Find the id of the flights whose distance is below average for their carrier.

Sample Solution:
SELECT id
FROM flights AS f
WHERE distance < (
 SELECT AVG(distance)
 FROM flights
 WHERE carrier = f.carrier);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts