🖤 Black Friday Sale – Save Up to 40% on Online Courses! Only Until the End of November!

Check Out the Sale
Rafał Podraza
SQL Practice Workbook: 100 Exercises with Solutions
SQL Practice Workbook: 100 Exercises with Solutions
Book / E-book• Databases & SQL

SQL Practice Workbook: 100 Exercises with Solutions

100 Hands-On SQL Challenges, Solutions, Explanations & a Free SQLite Practice Database

4.9(104 reviews)

Master SQL through 100 hands-on exercises, from beginner queries to advanced data analysis. Practice SELECT, JOINs, GROUP BY, subqueries, CTEs, window functions, and business reporting using a realistic SQLite retail database. Includes complete solutions, clear explanations, sample results, and free access to downloadable practice database resources.

Description

SQL Practice Workbook – 100 Exercises with Solutions

Learn SQL by writing real queries, solving practical challenges, and analyzing business data.

Are you learning SQL and looking for an effective way to practice your skills? Do you want to go beyond theoretical explanations and gain confidence in writing SQL queries independently?

SQL Practice Workbook is a hands-on learning resource featuring 100 practical SQL exercises, complete solutions, explanations, and a downloadable SQLite practice database.

Designed for beginners, aspiring data analysts, software testers, developers, and IT professionals, this workbook guides you from basic SQL statements to more advanced analytical queries.

What's Inside This Book?

100 Practical SQL Exercises

Work through 100 carefully organized challenges designed to develop your SQL skills progressively.

Start with simple data retrieval and filtering, then move into joins, aggregations, subqueries, common table expressions, window functions, and advanced business analysis.

10 Structured Chapters

The workbook organizes exercises into 10 chapters, allowing you to build a solid foundation before progressing to more complex topics.

Complete SQL Solutions

Every exercise includes a reference SQL query, an explanation of why the solution works, and a preview of the expected results.

Try solving each exercise yourself before checking the provided answer.

Realistic Retail Database

Practice using ShopLab, a fictional retail business database containing information about customers, products, categories, orders, order items, payments, and returns.

Explore relationships between tables and solve tasks inspired by everyday business reporting and data analysis.

Downloadable SQLite Database and Practice Resources

Access the companion GitHub repository to download the SQLite database and supporting resources.

The companion materials described in the book include:

  • Ready-to-use SQLite database

  • Database setup script

  • SQL exercise workspace

  • Reference SQL solutions

  • Expected query results

  • Optional Python answer checker

Practice Without a Database Server

The workbook uses SQLite, so you can practice locally without installing or configuring a separate database server.

A SQLite-compatible application and the downloadable database are all you need to get started.

Topics Covered

Chapter 1: Selecting and Filtering Data

Learn to retrieve records, select specific columns, apply filters, and organize query results.

Chapter 2: Conditions and Calculated Columns

Practice logical conditions, calculated values, column aliases, CASE expressions, and handling missing data.

Chapter 3: Aggregates and Grouping

Work with COUNT, SUM, AVG, MIN, MAX, GROUP BY, and HAVING to summarize datasets.

Chapter 4: Joins and Relationships

Explore relationships between tables using joins, including situations involving missing related records.

Chapter 5: Order Values, Payments, and Returns

Calculate business values, analyze payments, evaluate discounts, and work with order and return information.

Chapter 6: Subqueries and Set Operations

Develop your skills with nested queries and SQL set operations such as UNION, INTERSECT, and EXCEPT.

Chapter 7: Dates and Text

Practice date calculations, text manipulation, and reporting based on time periods.

Chapter 8: CTEs and Business Summaries

Use common table expressions, including recursive CTEs, to build structured business queries.

Chapter 9: Window Functions

Explore ROW_NUMBER, RANK, DENSE_RANK, running totals, and other analytical window functions.

Chapter 10: Analytical Challenges

Apply your knowledge to more advanced scenarios, including customer spending, product return rates, cohort retention, and business performance reporting.

Who Is This Book For?

  • Beginners learning SQL from scratch

  • Students looking for practical database exercises

  • Junior and experienced data analysts

  • Software testers and QA engineers working with databases

  • Backend developers who want to strengthen their SQL knowledge

  • Business analysts working with structured data

  • IT professionals preparing for SQL interviews

  • Anyone who wants to improve SQL skills through practice

How to Use This Workbook

  1. Download the companion SQLite database.

  2. Open the database using your preferred SQLite client.

  3. Read an exercise and write your own SQL query.

  4. Execute the query and examine the results.

  5. Compare your solution with the reference answer.

  6. Read the explanation and identify possible improvements.

  7. Progress to the next exercise.

The workbook encourages active problem-solving rather than simply reading SQL examples.

Download the Practice Database

The companion database and supporting files are referenced in the following GitHub repository:

https://github.com/rafi9898/sql-database

The database is downloaded separately from the e-book.

Publication Details

Author: Rafał Podraza

Language: English

Format: Digital PDF

Length: 94 pages

Exercises: 100

Chapters: 10

Difficulty: Beginner to Advanced

Database: SQLite

Companion Resources: GitHub repository

Build Real SQL Skills Through Practice

Whether you are starting your SQL journey or improving your analytical skills, this workbook provides a structured way to practice writing queries, understanding data relationships, and solving business-oriented database challenges.

Stop just reading SQL. Start writing it!

FormatPDF
Pages94
JęzykEnglish

Other books

View all books
ISTQB CT-GenAI 1.1: 200 Practice Questions & Mock Exams
ISTQB CT-GenAI 1.1: 200 Practice Questions & Mock Exams

ISTQB CT-GenAI 1.1: 200 Practice Questions & Mock Exams

Prepare for the ISTQB Certified Tester Testing with Generative AI (CT-GenAI 1.1) certification with 200 original practice questions and 5 full-length mock exams. Explore prompt engineering, GenAI-assisted software testing, AI risks, LLM infrastructure, and organizational adoption. Includes detailed answer explanations, weighted scoring, and coverage of all 37 examinable learning objectives.

$11.99
View book
ISTQB CT-AI 2.0: 200 Practice Questions & Mock Exams
ISTQB CT-AI 2.0: 200 Practice Questions & Mock Exams

ISTQB CT-AI 2.0: 200 Practice Questions & Mock Exams

Prepare for the ISTQB Certified Tester AI Testing (CT-AI 2.0) certification with 200 original practice questions and 5 full-length mock exams. Explore AI-based systems, machine learning, AI quality characteristics, test data, model testing, and AI-specific testing techniques. Includes detailed answer explanations, realistic scenarios, and structured coverage of all seven syllabus chapters.

$11.99
View book
$14.99