Back to Practice
#0344
Union All Event Volume
EasySQL15 min10 XP
Problem
Return the total number of event rows across web_events and app_events.
Why This Matters
SQL interviews usually test whether you can turn a business question into the right rows, grouping level, join type, and edge-case behavior.
Schema
web_events(event_id INTEGER); app_events(event_id INTEGER)
Examples
Example 1
Input2 web rows and 3 app rows
Output5
UNION ALL keeps every row, including duplicate event_id values.
Constraints
- Return only the requested columns.
- Use deterministic ORDER BY when multiple rows are returned.
- Assume SQLite-compatible SQL unless the prompt states otherwise.
CodeSQL
Visible browser tests run here when available.
Testcases1 visible / 3 hidden categories
Core SQL case
Input2 web rows and 3 app rows
Expected[[5]]
UNION ALL keeps every row, including duplicate event_id values.
Hidden Test Categories
Empty or missing matchesDuplicate rows or tiesNULL values where the pattern commonly breaks