Advanced SQL and Database Optimisation Training Course

Duration 10 days 18 modules · 65 contact hours
Level Advanced Certificate on completion
Who attends Database Administrators, SQL Developers and others
Fee from USD 2,200 KSh 190,000 for Kenyan organisations
Where 52 cities + online See dates by city
Next start 16 Nov 2026 Course code SD-DS-056

Before you join: Participants should have practical experience writing SQL SELECT, INSERT, UPDATE and DELETE statements against a relational database.

Dates & prices

Two start dates a month in every city, and live online on weekdays or weekends. Fees are per participant; classroom fees include tuition, materials, lunch and refreshments, and the certificate.

Suggest a date or city

Showing the next six months. Later dates, other cities and private deliveries for your team are available on request.

Course overview

Poorly performing SQL affects customer-facing applications, reporting deadlines, batch processing windows and infrastructure cost. Database teams often face a mix of slow queries, blocking sessions, unstable execution plans and rising storage volumes, yet lack a repeatable method for identifying root causes. Effective optimisation requires more than rewriting a query: it requires evidence from workload patterns, execution plans, statistics, indexes, transaction behaviour and physical database design.

This course develops advanced SQL writing and database optimisation skills for professionals responsible for production data platforms. Participants analyse logical query processing, complex joins, window functions, recursive common table expressions, transactions and isolation levels. They learn to read execution plans, estimate cardinality errors, select and maintain indexes, improve partitioned tables, reduce locking contention and tune SQL using measured baselines. The course addresses optimisation methods used across relational platforms while highlighting where PostgreSQL, Microsoft SQL Server and Oracle provide different diagnostic facilities.

Teaching combines concise technical briefings with instructor-led demonstrations, realistic cases and structured analysis of database workloads. Participants work with query plans, runtime metrics, table distributions and operational constraints similar to those found in banking, government, telecommunications and large corporate systems. They develop a reusable SQL performance review pack containing workload findings, query rewrites, index recommendations, measurement results and implementation priorities.

The course suits experienced SQL developers, database administrators, data engineers and technical analysts who need to improve database performance without compromising correctness, recoverability or service availability.

What you will be able to do

  • Analyse database workloads using query latency, frequency, resource consumption and service-level targets
  • Construct advanced SQL using window functions, recursive CTEs, lateral joins and set-based techniques
  • Interpret execution plans to identify inefficient operators, cardinality errors and access-path choices
  • Rewrite inefficient SQL using predicate placement, join ordering and set-based transformation methods
  • Design indexes using selectivity, covering columns, filtered predicates and write-cost analysis
  • Diagnose locking, blocking and deadlock incidents using transaction isolation and wait evidence
  • Produce a database tuning plan with baselines, recommendations, risks and validation criteria
  • Present a complete SQL optimisation case with measured performance improvements and implementation priorities

Benefits of attending

For you

  • Faster diagnosis of slow-query root causes using execution-plan evidence
  • Stronger credibility in database performance reviews and incident investigations
  • Reusable methods for rewriting costly reporting and transactional SQL
  • Practical index-design judgement balancing read performance and write overhead
  • A documented optimisation case suitable for workplace application

For your organisation

  • Reduced query latency for business-critical applications and reports
  • Lower infrastructure pressure from inefficient scans, sorts and temporary storage
  • Fewer production incidents caused by blocking, deadlocks and plan regressions
  • More defensible index and partitioning decisions based on measured workload evidence
  • Repeatable tuning documentation for change control and operational handover

Course modules

18 modules over 10 days

Participants can define measurable workload baselines and prioritise database performance investigations.

  • Workload classification by transactional, reporting, batch and mixed processing patterns
  • Response-time percentiles, throughput, concurrency and error-rate performance indicators
  • Service-level objectives translated into measurable database performance acceptance criteria
  • Baseline capture using representative data volumes and concurrent user conditions
  • Hotspot prioritisation through execution frequency, elapsed time and resource consumption
  • Performance budgets allocated across application, network, database and storage layers

Participants can relate logical SQL constructs to relational operations and physical data access.

  • Logical query-processing order for FROM, WHERE, GROUP BY and HAVING clauses
  • Relational algebra concepts behind selection, projection, joins and aggregation
  • Primary keys, foreign keys and functional dependencies affecting join correctness
  • Normalisation trade-offs between update integrity, reporting convenience and query cost
  • Data skew, null distributions and correlation within operational tables
  • Fact and dimension table patterns used in analytical database workloads

Participants can write efficient complex joins and choose appropriate subquery transformations.

  • Inner, outer, semi and anti joins matched to business rules
  • Join predicates that preserve cardinality and prevent accidental row multiplication
  • EXISTS and NOT EXISTS patterns for correlated existence tests
  • Scalar subqueries, decorrelation opportunities and repeated execution costs
  • LATERAL and APPLY joins for parameterised rowset evaluation
  • Self-joins and temporal joins for hierarchy and history analysis

Participants can build analytical SQL using window functions without unnecessary self-joins.

  • PARTITION BY and ORDER BY clauses defining analytic calculation scope
  • ROW_NUMBER, RANK and DENSE_RANK for ordered business records
  • Running totals using window frames and cumulative aggregate functions
  • LAG and LEAD functions for period-on-period comparison logic
  • FIRST_VALUE and LAST_VALUE frame semantics and common result errors
  • Top-N per group queries using ranked common table expressions

Participants can structure multi-step SQL and traverse hierarchical data using recursive CTEs.

  • Non-recursive CTEs for readable multi-stage query decomposition
  • Materialisation behaviour and optimiser treatment across database platforms
  • Recursive CTE anchor members and recursive member construction
  • Hierarchy traversal for organisational, account and product structures
  • Cycle detection and maximum recursion safeguards for malformed hierarchies
  • Temporary result strategies using CTEs, derived tables and temporary tables

Participants can select efficient SQL patterns for combining, reshaping and parsing datasets.

  • UNION ALL versus UNION duplicate elimination and sorting costs
  • INTERSECT and EXCEPT for reconciliation and data-quality checks
  • Conditional aggregation for pivot-style reporting without procedural loops
  • PIVOT and UNPIVOT operators with platform-specific performance considerations
  • JSON extraction functions, generated columns and indexed search paths
  • String parsing methods that avoid repeated scalar function evaluation

Participants can diagnose transaction contention and select isolation behaviour for workload requirements.

  • ACID properties applied to financial, operational and reporting transactions
  • Read committed, repeatable read and serializable isolation semantics
  • Snapshot isolation benefits, version-store costs and update conflict risks
  • Lock modes, lock granularity and lock escalation mechanisms
  • Blocking-chain analysis using session, statement and wait information
  • Deadlock graphs interpreted through resource order and transaction scope

Participants can assess how storage structures and indexes affect query access paths.

  • Heap tables, clustered storage and row-location lookup implications
  • B-tree index structure, page splits and key ordering
  • Index selectivity measured through distinct values and predicate distributions
  • Composite index key order based on equality, range and sorting predicates
  • Covering indexes using included columns and index-only access
  • Write amplification, index maintenance and storage-cost trade-offs

Participants can identify estimation errors and improve optimiser statistics decisions.

  • Cardinality estimates compared with actual rows at each plan operator
  • Histograms representing skewed values and non-uniform predicate selectivity
  • Stale statistics caused by bulk loads, deletes and data drift
  • Column correlation and independence assumptions affecting multi-predicate estimates
  • Sampling rates, statistics targets and auto-update thresholds
  • Parameter sensitivity and value-dependent execution plan selection

Participants can interpret execution plans and isolate the operators driving elapsed time.

  • EXPLAIN and EXPLAIN ANALYZE outputs distinguished by estimated and actual metrics
  • Table scans, index seeks and bitmap scans matched to predicates
  • Nested loop, hash and merge join algorithms compared
  • Sort, hash aggregate and spool operators analysed for memory pressure
  • Parallel execution exchanges, worker skew and coordination overhead
  • Plan warnings involving spills, implicit conversions and residual predicates

Participants can rewrite SQL to reduce work while preserving query semantics.

  • SARGable predicates replacing functions applied to indexed columns
  • Predicate pushdown to reduce rows before joins and aggregation
  • Join elimination where referential constraints prove redundant access
  • Anti-join rewrites replacing costly NOT IN null semantics
  • Set-based UPDATE and DELETE statements replacing row-by-row processing
  • Pagination methods compared for offset cost and keyset efficiency

Participants can recommend index changes supported by query patterns and operational evidence.

  • Filtered indexes targeted at selective, stable predicate subsets
  • Partial indexes and expression indexes for specialised access patterns
  • Columnstore indexes for scan-heavy analytical query workloads
  • Full-text indexes distinguished from wildcard predicate search
  • Duplicate and overlapping index detection through key-prefix analysis
  • Rebuild, reorganise and vacuum decisions based on fragmentation evidence

Participants can design partitioning approaches that support retention, loading and query pruning.

  • Range, list, hash and composite partitioning scheme selection
  • Partition pruning requirements for predicates and partition keys
  • Local and global index choices under partition maintenance operations
  • Sliding-window retention using partition switch, detach and drop operations
  • Bulk loading methods, minimal logging and batch commit sizing
  • Archival table design for regulatory retention and historical reporting

Participants can assess procedural database code and temporary-object choices for performance.

  • Temporary tables, table variables and CTEs compared for optimiser visibility
  • Stored procedure parameter handling and plan-cache implications
  • Dynamic SQL parameterisation and injection-safe construction methods
  • Cursor replacement using window functions and set-based updates
  • Batch processing loops controlled through chunk size and commit frequency
  • Error handling patterns preserving transaction consistency and diagnostic detail

Participants can use runtime evidence to detect bottlenecks and manage plan regressions.

  • Wait-event analysis separating CPU, I/O, lock and memory symptoms
  • Query-store history used to compare plans and runtime regressions
  • Oracle AWR reports interpreted for workload and top-SQL diagnosis
  • PostgreSQL pg_stat_statements metrics for high-cost query identification
  • Plan cache inspection for compilation frequency and parameter sensitivity
  • Alert thresholds based on baseline deviation and service-level objectives

Participants can prepare performance changes that protect availability and data integrity.

  • Online index operations and maintenance-window risk assessment
  • Rollback plans for query, index and schema performance changes
  • Canary release methods for database changes under controlled load
  • Load-test scenarios covering peak concurrency, failure and recovery conditions
  • Replication lag and read-replica routing performance considerations
  • Change records documenting assumptions, dependencies, validation and ownership

Participants can establish governance routines for sustained database performance management.

  • Capacity forecasts using growth rates, seasonality and workload projections
  • CPU, memory, storage latency and network utilisation interpretation
  • Database performance scorecards linking metrics to service objectives
  • Query review standards for code changes and release approval
  • Index ownership registers and scheduled maintenance responsibilities
  • Tuning backlogs prioritised by benefit, risk, effort and dependency

Participants can build, review and present a complete evidence-based SQL and database optimisation plan.

  • Workload baseline assembled from query metrics, plans and system observations
  • Problem queries selected using impact, frequency and business criticality
  • SQL rewrites tested against correctness, runtime and resource measurements
  • Index and statistics recommendations justified through access-path evidence
  • Concurrency and deployment risks assessed with mitigation and rollback actions
  • Final optimisation plan presented with priorities, owners and validation criteria

Exercises and examples are adapted to each cohort's sectors and roles.

What you take back to work

  1. Database workload baseline template
  2. Execution-plan review checklist
  3. SQL rewrite decision matrix
  4. Index design assessment worksheet
  5. Concurrency incident analysis model
  6. Database optimisation action plan

Who should attend

  • Database Administrators — diagnose production performance, concurrency and indexing problems
  • SQL Developers — write efficient queries and interpret execution-plan evidence
  • Data Engineers — optimise transformation pipelines, staging tables and batch workloads
  • Data Analysts — improve complex reporting queries against large relational datasets
  • Application Developers — reduce database bottlenecks in transactional applications
  • Technical Architects — assess database design choices, capacity demands and tuning priorities

Skills and tools covered

Advanced SQL designExecution plan analysisIndex strategyQuery optimisationConcurrency troubleshootingWorkload tuning

Tools and standards

EXPLAIN ANALYZE, PostgreSQL pg_stat_statements, SQL Server Query Store, Oracle Automatic Workload Repository

How the course runs

Training methodology

The instructor uses short technical briefings followed by guided analysis of realistic database workloads. Participants inspect SQL statements, execution plans, row estimates, wait data and index definitions, then compare alternative designs against stated performance targets. Group work examines trade-offs between response time, write cost, storage, recoverability and concurrency. Simulated tuning reviews require participants to prioritise findings and justify recommendations. Application planning connects the methods to each participant's own database estate, reporting workload or application backlog.

Requirements and prerequisites

Participants should have practical experience writing SQL SELECT, INSERT, UPDATE and DELETE statements against a relational database. They should understand tables, primary and foreign keys, basic joins, aggregates and simple indexes, and be comfortable reading query results. Familiarity with one production database platform such as PostgreSQL, Microsoft SQL Server, Oracle or MySQL is useful. Programming experience, advanced mathematics and prior database administration certification are not required. The course does not assume prior knowledge of execution plans, partitioning or transaction-isolation internals.

A typical training day

08:30 – 10:30First session
10:30 – 10:45Refreshment break
10:45 – 12:30Second session
12:30 – 13:30Lunch and networking
13:30 – 15:00Third session
15:00 – 15:15Refreshment break
15:15 – 16:30Workshop and daily review

Live online deliveries follow the same structure in East Africa Time, with shorter screen blocks and longer breaks.

What the fee includes

  • Instruction by a practitioner facilitator
  • Full course workbook and materials
  • Exercise files, templates and case studies
  • Refreshments and lunch on classroom deliveries
  • Certificate of completion
  • Post-course application plan

Frequently asked questions

You should already write routine SQL and understand tables, joins, keys and aggregates. The course begins beyond introductory SQL, but it teaches execution-plan analysis and optimisation methods from first principles.

Bring a laptop if attending in person, together with any non-sensitive examples of slow queries or recurring database issues. Training materials and access instructions for course databases are provided by the instructor.

It is intended for experienced SQL developers, database administrators, data engineers, application developers and technical analysts. Participants benefit most when they support production systems, reporting platforms or high-volume data processing.

Introductory SQL courses focus on retrieving and changing data, while this course concentrates on runtime behaviour, execution plans, statistics, indexes and concurrency. It also differs from general DBA training by placing substantial attention on query design and measured optimisation.

Participants can use the workload baseline, plan-review checklist and tuning plan to investigate a live performance concern or planned database change. The methods support query reviews, incident analysis, index proposals and release validation.

Each day runs from 08:30 to 16:30 and provides about 6.5 contact hours. The first part builds advanced SQL and diagnostic foundations, while the later modules focus on optimisation, operational controls and the final case review.

Questions about this course?

Ask about dates, fees, group bookings or running it for your team. Our training team replies by email.