84

Active vs Returned Books

HardCASESUMconditional aggregation

Problem Description

Write a SQL query to create a summary showing borrowed vs returned books by genre.

Expected Columns

  • genre
  • currently_borrowed
  • returned

Example Output

| genre | currently_borrowed | returned | |-------|--------------------|----------| | Fiction | 2 | 2 | | History | 1 | 0 | | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#84 Active vs Returned Books
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results