sqlstreak

Paws & Whiskers Shelter: a free sample database for SQL practice

Paws & Whiskers is the friendliest way to start with SQL: twenty animals with clear columns (species, breed, age, weight, adoption status), plus a table of raw adoption requests imported from a web form, complete with inconsistent text, empty strings and NULLs to clean up.

Download .sql (PostgreSQL + SQLite) SQLite .db CSV (zip) Query it online2 tables · 32 rows · CC BY 4.0

Tables and columns

Twenty animals waiting for a home, and the people who adopt them.

Paws & Whiskers Shelter: tables, keys and how they connectpets🔑 idnamespeciesbreedageweight_kgadoptedarrived_onadoption_requests🔑 idpet_nameemailphonerequested_onbudget
🔑 primary key · blue columns point at another table (foreign keys); the arrows show where.

pets

20 rows

Every animal that has come through the shelter.

  • idinteger
  • nametext
  • speciestextdog, cat, rabbit or bird
  • breedtextempty (NULL) for mixed breeds
  • ageintegeryears
  • weight_kgnumeric
  • adoptedboolean
  • arrived_ondate

adoption_requests

12 rows

Raw requests from the website form, imported as-is. Expect mess.

  • idinteger
  • pet_nametexttyped by visitors
  • emailtext
  • phonetextsometimes empty, sometimes NULL
  • requested_ondate
  • budgettextlike '$120', '80' or ''

What the data looks like

The first five rows of each table.

pets

idnamespeciesbreedageweight_kgadoptedarrived_on
1BiscuitdogBeagle311.202026-01-14
2MochicatSiamese24.112025-11-02
3PicklesdogNULL724.502025-09-21
4LunacatNULL53.802026-02-03
5WafflesrabbitHolland Lop11.612026-03-11

adoption_requests

idpet_nameemailphonerequested_onbudget
1 Biscuitana@mail.com555-01012026-10-01$120
2mochiBEN@MAIL.COM2026-10-0280
3Biscuit Ana@Mail.comNULL2026-10-05$150
4Lunacara@mail.com555-01042026-10-06NULL
5PICKLESdev@mail.com555-01052026-10-07$60

SQL practice questions for this database

Good for: First SELECT, WHERE and ORDER BY · NULL vs empty string · CASE WHEN labels · Data cleaning with TRIM, LOWER, NULLIF · Dates and strings. Try them yourself first, then compare.

Animals still waiting for a home, oldest firstShow a solution
SELECT name, species, age
FROM pets
WHERE adopted = false
ORDER BY age DESC;

Result (PostgreSQL and SQLite, identical): first 8 of 12 rows

namespeciesage
Tofucat11
Gizmodog10
Brunodog9
Sockscat8
Picklesdog7
Ziggybird6
Lunacat5
Rocketdog5
How many pets of each speciesShow a solution
SELECT species, COUNT(*) AS pets
FROM pets
GROUP BY species
ORDER BY pets DESC;

Result (PostgreSQL and SQLite, identical): 4 rows

speciespets
dog8
cat7
rabbit3
bird2
Pets with no recorded breedShow a solution
SELECT name, species
FROM pets
WHERE breed IS NULL;

Result (PostgreSQL and SQLite, identical): 6 rows

namespecies
Picklesdog
Lunacat
Cloverrabbit
Tofucat
Beandog
Pumpkincat
Label pets by age groupShow a solution
SELECT name, age,
  CASE WHEN age < 2 THEN 'young'
       WHEN age < 8 THEN 'adult'
       ELSE 'senior' END AS age_group
FROM pets;

Result (PostgreSQL and SQLite, identical): first 8 of 20 rows

nameageage_group
Biscuit3adult
Mochi2adult
Pickles7adult
Luna5adult
Waffles1young
Bruno9senior
Pepper1young
Noodle4adult
The heaviest pet of each speciesShow a solution
SELECT species, name, weight_kg
FROM (SELECT species, name, weight_kg,
        ROW_NUMBER() OVER (PARTITION BY species ORDER BY weight_kg DESC) AS rn
      FROM pets) t
WHERE rn = 1
ORDER BY species;

Result (PostgreSQL and SQLite, identical): 4 rows

speciesnameweight_kg
birdZiggy0.1
catSocks7.4
dogBruno30.1
rabbitJuniper3.4
Adoption rate per speciesShow a solution
SELECT species,
       ROUND(100.0 * SUM(CASE WHEN adopted THEN 1 ELSE 0 END) / COUNT(*), 0) AS adopted_pct
FROM pets
GROUP BY species
ORDER BY species;

Result (PostgreSQL and SQLite, identical): 4 rows

speciesadopted_pct
bird50
cat43
dog25
rabbit67
Arrivals per monthShow a solution
SELECT SUBSTR(CAST(arrived_on AS TEXT), 1, 7) AS month, COUNT(*) AS arrivals
FROM pets
GROUP BY 1
ORDER BY 1;

Result (PostgreSQL and SQLite, identical): first 8 of 15 rows

montharrivals
2025-041
2025-051
2025-061
2025-071
2025-081
2025-091
2025-102
2025-111
Names starting with BShow a solution
SELECT name, species
FROM pets
WHERE name LIKE 'B%'
ORDER BY name;

Result (PostgreSQL and SQLite, identical): 3 rows

namespecies
Beandog
Biscuitdog
Brunodog
Requests with a usable phone numberShow a solution
SELECT COUNT(*) AS with_phone
FROM adoption_requests
WHERE NULLIF(TRIM(phone), '') IS NOT NULL;

Result (PostgreSQL and SQLite, identical): 1 row

with_phone
7
Clean the pet names in the requestsShow a solution
SELECT id, pet_name AS raw, LOWER(TRIM(pet_name)) AS cleaned
FROM adoption_requests
ORDER BY id;

Result (PostgreSQL and SQLite, identical): first 8 of 12 rows

idrawcleaned
1 Biscuitbiscuit
2mochimochi
3Biscuit biscuit
4Lunaluna
5PICKLESpickles
6lunaluna
7Tofutofu
8 Pepperpepper
People who sent more than one requestShow a solution
SELECT LOWER(TRIM(email)) AS email, COUNT(*) AS requests
FROM adoption_requests
GROUP BY LOWER(TRIM(email))
HAVING COUNT(*) > 1
ORDER BY email;

Result (PostgreSQL and SQLite, identical): 4 rows

emailrequests
ana@mail.com2
ben@mail.com2
cara@mail.com2
gus@mail.com2
Average weight per species, one decimalShow a solution
SELECT species, ROUND(AVG(weight_kg), 1) AS avg_kg
FROM pets
GROUP BY species
ORDER BY avg_kg DESC;

Result (PostgreSQL and SQLite, identical): 4 rows

speciesavg_kg
dog17.1
cat4.6
rabbit2.4
bird0.1

How to load it

SQLite: sqlite3 animal-shelter.db < sqlstreak-animal-shelter-sample-database.sql

PostgreSQL: psql -d yourdb -f sqlstreak-animal-shelter-sample-database.sql

Or skip installing anything and query it in your browser.

License

Free to use in courses, tutorials, blog posts and interviews under CC BY 4.0. Please credit it with a link: Data: sqlstreak.com/datasets/animal-shelter

Teaching with it? Tell me and I'll help.

Practise on this data every day

sqlstreak's lessons use these tables: five-minute exercises with instant feedback and a streak. No account needed to start.

Start the first lesson

Guides that use it

Practice on it

More sample databases