runtime
80 / 139

task COUNT / SUM / AVG / MIN / MAX · medium

Debug: count zero projects correctly

Find every workspace created in June 2025. Return account_id and projects. Workspaces without projects currently show 1. Fix the count.

what to return

Columns
account_idprojects in this order
Rows
306 rows · any order
Skill
Repair the query’s logic and confirm the fix on changed data. Refresher: Keep unmatched rows →

expected result

expected result306 rows · any order
account_idprojects
28951
28961
28970

first 3 of 306 rows

data you can query

accounts7 columns · 3,200 rows
account_idnumber · unique idaccount_nametextindustrytextcompany_sizetextcountrytextacquisition_channeltextcreated_atdate & time
1Iron Capital IncLogistics11-50United Statesorganic2024-01-14 18:52:14
2Vector Data CoNonprofit51-200United Kingdomsocial2024-01-15 13:21:52
3True Foods IncHealthcare201-1000United Statesoutbound_sales2024-01-19 11:22:02
4Meridian WorksSoftware11-50United Statesorganic2024-01-23 23:42:36
5Prism Health GroupSoftware1-10Germanyreferral2024-01-25 11:43:43
6Beacon Supply LtdMedia1000+United Kingdomorganic2024-01-27 20:19:28
7Birch Health GroupSoftware11-50United Statespaid_search2024-01-28 01:19:58
8Slate Robotics GroupEducation51-200United Statespaid_search2024-01-28 08:03:16
9Falcon LearningManufacturing51-200United Statesoutbound_sales2024-02-02 05:14:26
10Pine Software CoHealthcare1-10United Statessocial2024-02-04 18:06:48
account_idnumber · unique id
1
account_nametext
Iron Capital Inc
industrytext
Logistics
company_sizetext
11-50
countrytext
United States
acquisition_channeltext
organic
created_atdate & time
2024-01-14 18:52:14
account_idnumber · unique id
2
account_nametext
Vector Data Co
industrytext
Nonprofit
company_sizetext
51-200
countrytext
United Kingdom
acquisition_channeltext
social
created_atdate & time
2024-01-15 13:21:52
account_idnumber · unique id
3
account_nametext
True Foods Inc
industrytext
Healthcare
company_sizetext
201-1000
countrytext
United States
acquisition_channeltext
outbound_sales
created_atdate & time
2024-01-19 11:22:02
account_idnumber · unique id
4
account_nametext
Meridian Works
industrytext
Software
company_sizetext
11-50
countrytext
United States
acquisition_channeltext
organic
created_atdate & time
2024-01-23 23:42:36
account_idnumber · unique id
5
account_nametext
Prism Health Group
industrytext
Software
company_sizetext
1-10
countrytext
Germany
acquisition_channeltext
referral
created_atdate & time
2024-01-25 11:43:43
account_idnumber · unique id
6
account_nametext
Beacon Supply Ltd
industrytext
Media
company_sizetext
1000+
countrytext
United Kingdom
acquisition_channeltext
organic
created_atdate & time
2024-01-27 20:19:28
account_idnumber · unique id
7
account_nametext
Birch Health Group
industrytext
Software
company_sizetext
11-50
countrytext
United States
acquisition_channeltext
paid_search
created_atdate & time
2024-01-28 01:19:58
account_idnumber · unique id
8
account_nametext
Slate Robotics Group
industrytext
Education
company_sizetext
51-200
countrytext
United States
acquisition_channeltext
paid_search
created_atdate & time
2024-01-28 08:03:16
account_idnumber · unique id
9
account_nametext
Falcon Learning
industrytext
Manufacturing
company_sizetext
51-200
countrytext
United States
acquisition_channeltext
outbound_sales
created_atdate & time
2024-02-02 05:14:26
account_idnumber · unique id
10
account_nametext
Pine Software Co
industrytext
Healthcare
company_sizetext
1-10
countrytext
United States
acquisition_channeltext
social
created_atdate & time
2024-02-04 18:06:48

first 10 of 3,200 rows · your queries use all of them

projects6 columns · 9,962 rows
project_idnumber · unique idaccount_idnumber · links to accountscreated_by_user_idnumber · links to usersproject_nametextcreated_atdate & timearchived_atdate & time
111Marketing Calendar2024-02-23 16:32:02NULL
211Customer Onboarding 22024-02-23 16:33:07NULL
311Website Redesign 32024-02-23 16:36:342024-05-15 08:53:27
412Marketing Calendar2024-01-27 00:29:22NULL
512Sales Pipeline 22024-02-03 17:23:30NULL
613Marketing Calendar2024-02-13 09:10:19NULL
713Data Migration 22024-02-14 10:21:49NULL
813Q3 Planning 32024-03-13 21:16:482024-11-02 21:27:40
9311Weekly Metrics2024-01-29 21:43:07NULL
10311Sales Pipeline 22024-02-21 15:48:10NULL
project_idnumber · unique id
1
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
1
project_nametext
Marketing Calendar
created_atdate & time
2024-02-23 16:32:02
archived_atdate & time
NULL
project_idnumber · unique id
2
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
1
project_nametext
Customer Onboarding 2
created_atdate & time
2024-02-23 16:33:07
archived_atdate & time
NULL
project_idnumber · unique id
3
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
1
project_nametext
Website Redesign 3
created_atdate & time
2024-02-23 16:36:34
archived_atdate & time
2024-05-15 08:53:27
project_idnumber · unique id
4
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
2
project_nametext
Marketing Calendar
created_atdate & time
2024-01-27 00:29:22
archived_atdate & time
NULL
project_idnumber · unique id
5
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
2
project_nametext
Sales Pipeline 2
created_atdate & time
2024-02-03 17:23:30
archived_atdate & time
NULL
project_idnumber · unique id
6
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
3
project_nametext
Marketing Calendar
created_atdate & time
2024-02-13 09:10:19
archived_atdate & time
NULL
project_idnumber · unique id
7
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
3
project_nametext
Data Migration 2
created_atdate & time
2024-02-14 10:21:49
archived_atdate & time
NULL
project_idnumber · unique id
8
account_idnumber · links to accounts
1
created_by_user_idnumber · links to users
3
project_nametext
Q3 Planning 3
created_atdate & time
2024-03-13 21:16:48
archived_atdate & time
2024-11-02 21:27:40
project_idnumber · unique id
9
account_idnumber · links to accounts
3
created_by_user_idnumber · links to users
11
project_nametext
Weekly Metrics
created_atdate & time
2024-01-29 21:43:07
archived_atdate & time
NULL
project_idnumber · unique id
10
account_idnumber · links to accounts
3
created_by_user_idnumber · links to users
11
project_nametext
Sales Pipeline 2
created_atdate & time
2024-02-21 15:48:10
archived_atdate & time
NULL

first 10 of 9,962 rows · your queries use all of them

solution.sql
 
Output

Hints and the answer are always available. Using them counts the question as solved with help.

Debug: count zero projects correctly — SQL practice · Runtime