Learn with Abdou

Chapter 7 · Concept 3 of 6 · Practice

The disappearing branch dashboard

COUNT(key) versus COUNT(*), and a condition in ON versus WHERE · level 2 of 6

Opening your saved work…

Sign in to save across devices → · Download your guest work before switching accounts.

The disappearing branch dashboard · COUNT(key) versus COUNT(*), and a condition in ON versus WHERE · level 2 of 6

Garden tools per branch, zero included

Level 2: Fill the blank · Exercise 1 of 1

The category condition is already in ON. One piece of the count is missing: what should be counted so that Cloquet, which owns no garden tools, shows 0?

Finish line: 6 rows · columns branch_id, branch, garden_tools · in the order the question gives

Data: Twin Ports Tool Library.

Fill the blankOpening the database…
SELECT b.id AS branch_id, b.name AS branch, COUNT() AS garden_tools FROM branches b LEFT JOIN tools t ON t.branch_id = b.id AND t.category = 'Garden' GROUP BY b.id, b.name ORDER BY b.id;
  1. Blank 1 of 1: what to count
Open in the playground

Query results

Check to see the result here.

Check to see the result here.

Practice here is evidence for you and your instructor, never a grade. Grades live in Canvas.