Modern QA2026Exercises
Log inJoin
13 / 20 · Book 15 · Your First SELECT -- Reading the Source of Truth← prev⊞ allnext →Get the book →

1.13Exercises

Beginner:

  1. Write a SELECT query to find all users with the role 'admin'.
  2. Write a query to count how many users have email_verified = false.
  3. Write a query to find the most recently created user.

Intermediate:

  1. Write a query that finds users whose updated_at equals created_at (never modified).
  2. Write a Python test that creates a user via API and verifies the default role in the database.
  3. Write a query to find all soft-deleted users (deleted_at IS NOT NULL) created in the last 30 days.

Advanced:

  1. Write a verification query that returns rows ONLY if there is an inconsistency between the users table and user_profiles table (every user should have a profile).
  2. Write a comprehensive Python test fixture that provides both API client and database cursor, with automatic cleanup.
  3. Write a query that detects timestamps in the future or before the year 2020, across all timestamp columns in the users table.

Career Translation