Back to problems

Count buggy vs non-buggy by employer

SQL · ByteDance · Easy

An application stores company data in an employers table and submitted entries in a submissions table. For every company, calculate two totals: how many of its entries are buggy (is_buggy = TRUE) and how many are non-buggy (is_buggy = FALSE). A company that has no submissions must still appear in the result, with both totals reported as 0. Write one SQL query that joins from employers to submissions using a LEFT JOIN and calculates the totals with conditional aggregation.…

Checking your access…