Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
SQL for Data Engineering - Practice Tests
32 students

SQL for Data Engineering - Practice Tests

Joins, window functions, CTEs, indexes, query plans, SCDs and CDC: scenario questions with every answer explained
Created byTech Coach
Last updated 6/2026
English

What you'll learn

  • Write correct joins and aggregations, and avoid the classic traps around WHERE vs. HAVING, GROUP BY and duplicated rows
  • Handle NULLs, CASE expressions, set operations and subqueries, including the NOT IN trap and when to use EXISTS
  • Use window functions for rankings, running totals, moving averages, LAG and LEAD, and understand how window frames work
  • Write CTEs and recursive queries, and read PostgreSQL execution plans with EXPLAIN and EXPLAIN ANALYZE
  • Choose the right index type and diagnose slow queries using statistics, partition pruning and parallel query
  • Model slowly changing dimensions and CDC, and build idempotent, incremental pipelines with MERGE and upserts

Included in This Course

248 questions
  • SELECT, Joins and Aggregation45 questions
  • NULLs, Set Operations and Subqueries37 questions
  • Window Functions37 questions
  • CTEs and Query Execution38 questions
  • Optimisation and Indexes47 questions
  • Modelling and Pipelines44 questions

Description

Practice the SQL that data engineering work really needs.

This course contains practice tests on the SQL behind pipelines, data warehouses and analytics: from joins and NULL handling to window functions, query plans, indexes and dimensional modeling. Each test covers one area, so you can work through the topics one at a time and see exactly where you need to study more. Every question explains why the correct answer works, what each of the other options really does and when you would use it instead, and links to the official documentation page it's based on. So a single question teaches you four ideas, not one.

· Practice Test 1 - SELECT, Joins and Aggregation: filtering, aliases, ORDER BY and LIMIT, inner and outer joins, anti-joins, GROUP BY, HAVING, ROLLUP and CUBE, medians and percentiles, string_agg, date ranges and time zones

· Practice Test 2 - NULLs, Set Operations and Subqueries: three-valued logic, COALESCE and NULLIF, CASE, UNION, INTERSECT and EXCEPT, scalar and correlated subqueries, EXISTS, IN and the NOT IN trap, IS DISTINCT FROM, relational division ('bought every product') and comparing two tables with EXCEPT ALL

· Practice Test 3 - Window Functions: ROW_NUMBER, RANK and DENSE_RANK, LAG and LEAD, running totals and moving averages, ROWS, RANGE and GROUPS frames, deduplication, gaps and islands, cohorts, z-score outliers and Snowflake's QUALIFY

· Practice Test 4 - CTEs and Query Execution: CTEs and their materialization, recursive queries and cycle detection, data-modifying CTEs, hierarchies with ltree, materialized views, LATERAL and WITH ORDINALITY, function volatility, EXPLAIN and EXPLAIN ANALYZE, join methods and partition pruning

· Practice Test 5 - Optimisation and Indexes: B-tree, hash, GIN and BRIN indexes, covering and partial indexes, full-text search, statistics and pg_stat_statements, keyset pagination, fillfactor and HOT updates, isolation levels, parallel query, reading execution plans

· Practice Test 6 - Modelling and Pipelines: slowly changing dimensions (Kimball Types 0 to 7), change data capture, MERGE and upserts, idempotent and incremental loads, watermarks, bulk loading with COPY, job queues with SKIP LOCKED, dbt snapshots, materializations, tests and incremental models

Checked against the documentation

PostgreSQL is the default dialect, and every fact is checked in the current PostgreSQL documentation. Where products differ, the explanation says so, and questions about Spark, Snowflake, dbt, Kafka or Debezium name the product and follow its own docs. Modeling questions follow the Kimball Group's dimensional modeling techniques.

Who it's for

Data engineers, analytics engineers and analysts who want to test and deepen their SQL, and developers preparing for SQL-heavy data engineering interviews.

How to use it

Take one test at a time and review every explanation, including those for the answers you got right. Try the queries in a local PostgreSQL database if you have one. Retake a test until you score above 80%.

Please note

These are original practice questions. They help you learn and test your knowledge, but they don't guarantee success in an interview or assessment. This course isn't affiliated with or endorsed by the PostgreSQL project or any of the other products mentioned. All product names are trademarks of their respective owners.

Who this course is for:

  • Data engineers and analytics engineers who want to check and deepen their SQL topic by topic
  • Data analysts moving into data engineering who know the basics and want to go further
  • Developers preparing for SQL-heavy data engineering interviews or technical assessments