# Welcome Wagon

> How many signed up this year?

Canonical URL: <https://datadriven.io/problems/welcome_wagon>

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

How many users signed up in 2026?

## Worked solution and explanation

### Why this problem exists in real interviews

This is a simple count with a date filter. Interviewers use it as a warm-up to verify that you can extract the year from a date column and apply it as a filter.

---

### Break down the requirements

#### Step 1: Filter to the target year

`WHERE signup_date >= '2026-01-01' AND signup_date < '2027-01-01'` captures all signups in the target year using a range scan.

#### Step 2: Count signups

`COUNT(*)` returns the total number of users who signed up in that year.

---

### The solution

**Year filter with count**

```sql
SELECT COUNT(*) AS signup_count
FROM users
WHERE signup_date >= '2026-01-01'
  AND signup_date < '2027-01-01'
```

> **Cost Analysis**
>
> The date range filter narrows 15M rows to a fraction. An index on `signup_date` enables a range scan. The COUNT is a streaming operation.

> **Interviewers Watch For**
>
> Whether you use `STRFTIME('%Y', signup_date) = '2026'` (function on every row, preventing index usage) vs. a range comparison (index-friendly).

> **Common Pitfall**
>
> Using `YEAR(signup_date) = 2026` which is not valid in SQLite. Use `STRFTIME('%Y', ...)` or a range comparison.

---

## Common follow-up questions

- How would you show signups per month within the year? _(Add GROUP BY STRFTIME('%m', signup_date) for a monthly breakdown.)_
- What if signup_date includes timestamps? _(The range comparison still works correctly for timestamps.)_
- How would you compute the year-over-year growth rate? _(Compare this year's count to last year's using a self-join or LAG.)_

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/welcome_wagon)
- [SQL Interview Questions](https://datadriven.io/sql-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.