backendgym backendgym · reps Sign in with GitHubSign in

03Count publisher records

sql-querying / reps/03/README.md

How many publisher records have at least one book? Return the publisher ID and name, one row per record, ordered by ID.

An assistant wrote the query in answer.sql. Read it first, then run it and compare with the expected result below. Fix it so it counts records instead of names.

Expected once fixed: 6 rows, IDs 1 to 6. The shipped query returns 5.

After the rep
  1. 1 Which two publisher IDs did the shipped query merge, and which word in it did that?
  2. 2 What does DISTINCT compare: the columns you select, or the rows they came from?