Call center sample database for SQLite
A ready-to-run SQLite script with calls with queue, reason, wait and handle time, resolution and CSAT. Tested on SQLite 3.37.2. Updated 19 November 2026.
Call center database for SQLite
Each row is one inbound call in 2024: date and time, agent, queue, reason, seconds on hold, handle time, whether it was resolved and the 1-5 survey score (blank when the caller skipped the survey).
This page has it as a SQLite script: one table and 1,000 rows, with column types chosen for SQLite, primary keys. The script drops the table if it exists, creates it and inserts the rows in one transaction, so you can run it again to reset the data. It is the same fictional data, seed 42, as on the call center dataset page, where it is also available as CSV and Excel.
We loaded this exact file into SQLite 3.37.2 and ran every question below on it; the answers shown are that output. The same questions, written for SQLite, PostgreSQL, MySQL, SQL Server and DuckDB, return the same results on all five.
Load it
Command line
sqlite3 practice.db < call-center-sqlite.sql
sqlite3 practice.db ".tables"Or skip the script
Download call-center.sqlite and open it in DB Browser for SQLite, DBeaver or: sqlite3 call-center.sqlite
Tables and columns
call_center 1,000 rows
| Column | SQLite type |
|---|---|
| call_id | TEXT |
| date | TEXT |
| time | TEXT |
| agent | TEXT |
| queue | TEXT |
| reason | TEXT |
| wait_seconds | INTEGER |
| handle_seconds | INTEGER |
| resolved | INTEGER |
| satisfaction | INTEGER |
Practice questions
answers from SQLite 3.37.2
How many calls did each queue take, and what share was resolved?
SQL
SELECT queue, COUNT(*) AS calls,
ROUND(1.0 * 100 * SUM(CASE WHEN resolved = 1 THEN 1 ELSE 0 END) / NULLIF(COUNT(*), 0), 2) AS resolved_pct
FROM call_center
GROUP BY queue
ORDER BY calls DESC, queue;SQLite has no boolean type: yes/no columns hold 1 and 0.
Result
| queue | calls | resolved_pct |
|---|---|---|
| Technical | 358 | 67.88 |
| Billing | 319 | 86.21 |
| Returns | 169 | 87.57 |
| Sales | 154 | 85.71 |
What are the average wait and handle times by queue, in seconds?
SQL
SELECT queue, ROUND(AVG(wait_seconds), 2) AS avg_wait, ROUND(AVG(handle_seconds), 2) AS avg_handle
FROM call_center
GROUP BY queue
ORDER BY avg_wait DESC, queue;AVG works on integers and decimals directly.
Result
| queue | avg_wait | avg_handle |
|---|---|---|
| Technical | 112.80 | 525.53 |
| Returns | 103.25 | 322.46 |
| Billing | 100.77 | 337.89 |
| Sales | 100.70 | 340.27 |
How many calls arrive in each hour of the day? (time is stored as HH:MM text)
SQL
SELECT substr(time, 1, 2) AS hour, COUNT(*) AS calls
FROM call_center
GROUP BY substr(time, 1, 2)
ORDER BY hour;substr(text, start, length) cuts out part of a string.
Result
| hour | calls |
|---|---|
| 08 | 75 |
| 09 | 94 |
| 10 | 87 |
| 11 | 83 |
| 12 | 78 |
| 13 | 76 |
| 14 | 91 |
| 15 | 92 |
| 16 | 90 |
| 17 | 80 |
| 18 | 76 |
| 19 | 78 |
Which 5 agents have the highest average satisfaction (at least 20 calls)?
SQL
SELECT agent, COUNT(*) AS calls, ROUND(AVG(satisfaction), 2) AS avg_sat
FROM call_center
GROUP BY agent
HAVING COUNT(*) >= 20
ORDER BY avg_sat DESC, agent
LIMIT 5;LIMIT n at the end returns the first n rows.
Result
| agent | calls | avg_sat |
|---|---|---|
| Linda Clark | 48 | 4.10 |
| Daniel Roberts | 56 | 4.06 |
| Charles Bell | 30 | 4.00 |
| Mary Baker | 42 | 4.00 |
| Aisha Miller | 47 | 3.94 |
What are the top 5 call reasons?
SQL
SELECT reason, COUNT(*) AS calls
FROM call_center
GROUP BY reason
ORDER BY calls DESC, reason
LIMIT 5;LIMIT n at the end returns the first n rows.
Result
| reason | calls |
|---|---|
| Login problem | 97 |
| Refund request | 96 |
| Invoice question | 94 |
| Setup help | 91 |
| Bug report | 89 |
How many calls were there per month?
SQL
SELECT strftime('%Y-%m', date) AS month, COUNT(*) AS calls
FROM call_center
GROUP BY strftime('%Y-%m', date)
ORDER BY month;strftime('%Y-%m', date) turns a date into year-month text.
Result
| month | calls |
|---|---|
| 2024-01 | 73 |
| 2024-02 | 89 |
| 2024-03 | 68 |
| 2024-04 | 88 |
| 2024-05 | 81 |
| 2024-06 | 75 |
| 2024-07 | 88 |
| 2024-08 | 94 |
| 2024-09 | 85 |
| 2024-10 | 78 |
| 2024-11 | 86 |
| 2024-12 | 95 |
SQLite differences used here
- AVG works on integers and decimals directly.
- SQLite has no boolean type: yes/no columns hold 1 and 0.
- substr(text, start, length) cuts out part of a string.
- LIMIT n at the end returns the first n rows.
- strftime('%Y-%m', date) turns a date into year-month text.