1. Advanced operations on data (DML)
Modifying larger datasets safely calls for techniques that go beyond basic INSERT, UPDATE, and DELETE statements. Participants use INSERT INTO ... SELECT, updates with joins or subqueries, conditional deletes, and MERGE for synchronization, with attention to scalable DML practices.
- inserting data using
INSERT INTO ... SELECT,
- updating data using subqueries and joins,
- deleting data using conditions and subqueries,
MERGE statement (UPSERT) – data synchronization,
- best practices when modifying large data sets.
2. Advanced SELECT queries
GROUP BY and aggregate functions provide the basis for summarizing data, but practical analysis also depends on precise filtering and result shaping. The section combines HAVING, advanced sorting, NULL handling, and conditional expressions such as CASE, COALESCE, and NULLIF.
- data grouping (
GROUP BY),
- aggregate functions (
COUNT, SUM, AVG, MIN, MAX),
- group filtering (
HAVING),
- advanced sorting of results,
- operations on
NULL values,
- conditional expressions (
CASE, COALESCE, NULLIF).
3. Subqueries and Common Table Expressions (CTE)
Complex retrieval often depends on choosing the right relationship between outer queries and intermediate result sets. The section covers correlated and uncorrelated subqueries in SELECT, FROM, and WHERE, operators such as EXISTS or ALL, plus CTEs and recursive CTE patterns.
- correlated and uncorrelated subqueries,
- subqueries in
SELECT, FROM and WHERE clauses,
EXISTS, NOT EXISTS, IN, ANY, ALL operators,
- Common Table Expressions (
WITH),
- recursive CTEs.
4. Query optimization
When queries slow down, performance work begins with how the engine reads data. Participants examine index impact, create and remove indexes, interpret EXPLAIN or EXPLAIN PLAN output, identify bottlenecks, and tune statements for large datasets using proven efficiency practices.
- indexes and their impact on performance,
- creating and deleting indexes,
- analysis of execution plans (
EXPLAIN, EXPLAIN PLAN),
- identification of bottlenecks,
- optimization of queries for large data sets,
- best practices for creating efficient queries.
5. Views
Views help separate data presentation, access control, and query complexity from base tables. This part covers simple and complex view definitions, joins and subqueries inside views, updating data through views, materialized views, and their role in restricting data exposure.
- creating simple and complex views,
- views using joins and subqueries,
- updating data through views,
- materialized views (in systems that support them),
- use of views for securing data.
6. Working with data types
Working across mixed datasets requires careful handling of values and formats. Participants practice type conversion, date and time functions, text processing, and operations on numeric types, with an additional look at JSON data handling where the database engine supports it.
- data type conversion,
- functions operating on dates and time,
- text functions,
- working with numeric types,
- handling JSON data (if supported by the database engine).
7. Analytical functions
Window functions extend SQL analysis beyond standard aggregation. The section uses OVER with ROW_NUMBER, RANK, DENSE_RANK, NTILE, LEAD, LAG, FIRST_VALUE, and LAST_VALUE, then applies them to running totals, moving averages, and set operators such as UNION or EXCEPT.
- window functions (
OVER),
ROW_NUMBER, RANK, DENSE_RANK, NTILE,
LEAD and LAG,
FIRST_VALUE and LAST_VALUE,
- running totals and moving averages,
- set operators (
UNION, UNION ALL, INTERSECT, EXCEPT).
8. Procedures, functions and automation
Automating database logic involves more than writing reusable code blocks. The training focuses on stored procedures and user-defined functions, input and output parameters, exception handling, debugging techniques, and the basics of implementing triggers for data-driven actions.
- creating stored procedures,
- user-defined functions,
- input and output parameters,
- exception handling,
- debugging procedures,
- basics of creating triggers (Triggers).
9. Transactions and concurrency
Reliable data changes depend on correct transaction handling and predictable concurrent access. Participants work with BEGIN, COMMIT, and ROLLBACK, compare isolation levels and locking behavior, and learn error-handling approaches that help preserve consistency.
- transaction management (
BEGIN, COMMIT, ROLLBACK),
- transaction isolation levels,
- locks and concurrency,
- error handling,
- ensuring data consistency.
10. Security and best practices
Securing database work requires connecting access control with safe coding practices. The section covers roles, user permissions, protection of sensitive data, Dynamic SQL risks, SQL Injection defenses, auditing basics, and rules for designing maintainable SQL code.
- roles and user permissions,
- securing sensitive data,
- Dynamic SQL – possibilities and threats,
- protection against SQL Injection,
- basics of auditing operations on the database,
- best practices for designing and maintaining SQL code.
11. Practical workshop
Starting from business requirements, participants translate real reporting and operational needs into SQL solutions. They build complex queries with CTEs and window functions, then refine them through execution plan analysis and targeted optimization to solve realistic database problems.
- business requirements analysis,
- building complex SQL queries,
- using CTE and window functions,
- query optimization,
- execution plan analysis,
- solving real problems using SQL.