backendgym backendgym · reps Sign in with GitHubSign in

03Include cards with no swipes

sql-designing-and-writing / reps/03/README.md

For every card, return its ID and total fare, including cards that were never used. An assistant wrote answer.sql. Read it first, then run it and compare with the expected result below. Fix it so every card is there.

Expected once fixed: 5 rows, with cards 4 and 5 at a total fare of 0. The shipped query returns 3 rows.

After the rep
  1. 1 Add WHERE s.fare > 0 to your fixed query. How many rows come back, and which side of the join is that filter really on?