Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Programming languages

PL/SQL & T-SQL (Oracle and SQL Server)

Database programming on Oracle and SQL Server: PL/SQL blocks and packages, T-SQL procedures, errors, transactions, cursors, plans, security and tests.

51 lessons to read 16 modules

51 lessons: 15 free with Pro answers and 36 with a free core.

Examples run with oracle-free 23.26.3.0.0 and mssql 17.0.5005.3.

Who it is for

Developers, analysts and DBAs who write or maintain stored procedures, packages and triggers on Microsoft SQL Server or Oracle Database, including people moving between the two.

What you will be able to do

  • Write T-SQL batches, stored procedures and functions with variables, control flow and table-valued parameters
  • Handle errors and transactions in T-SQL with TRY...CATCH, THROW, XACT_ABORT and XACT_STATE
  • Replace row-by-row cursors with set-based code built on temporary tables, MERGE with OUTPUT and window functions
  • Write PL/SQL blocks, procedures, functions and packages whose exceptions propagate the way you intend
  • Process rows in bulk in PL/SQL with BULK COLLECT, LIMIT, FORALL and SAVE EXCEPTIONS
  • Build dynamic SQL in both engines that binds every value and checks every identifier against an allowlist
  • Read execution plans in SQL Server and Oracle, and fix parameter sniffing and slow PL/SQL called from SQL
  • Test database code with tSQLt and utPLSQL, and port code between PL/SQL and T-SQL

Before this track

Revise and practise

Modules and lessons

What the labels mean

Free lesson, Pro answers
the whole lesson is free; the model answers to its interview questions open with a pass
Free core, Pro depth
the core of the lesson is free; its in-depth parts open with a pass
Pro
opens with a Pro, Premium or Ultimate pass

Minutes are reading time: “3 of 10 min free” means 3 minutes of the lesson are free.

What a pass opens in this track

72 in-depth parts and 126 interview answers. The same pass opens every other track and every Pro tool.

  1. Module 1

    Start here: two engines, versions and a verified lab

    What PL/SQL and T-SQL are and which releases you will meet, a lab with both engines on your own machine, and the practice schema with the dialect differences that break moved code.

    1. PL/SQL and T-SQL: what they are and where they run Beginner Free lesson, Pro answers: 15 minutes
    2. Set up a lab with Oracle 26ai and SQL Server 2025 Beginner Free lesson, Pro answers: 15 minutes
    3. The practice schema and dialect basics Beginner Free lesson, Pro answers: 10 minutes
  2. Module 2

    T-SQL foundations: batches, variables and routines

    Batches and GO, variables and their scope, IF, WHILE and CASE, stored procedures with parameters, and scalar, inline and multi-statement functions.

    1. T-SQL batches, GO and variables Beginner Free lesson, Pro answers: 10 minutes
    2. T-SQL control flow: IF, WHILE and CASE Beginner Free core, Pro depth: 3 of 10 minutes free
    3. T-SQL stored procedures and parameters Intermediate Free core, Pro depth: 3 of 10 minutes free
    4. T-SQL functions: scalar, inline and multi-statement Intermediate Free core, Pro depth: 3 of 10 minutes free
  3. Module 3

    T-SQL errors and transactions

    Transactions, @@TRANCOUNT and savepoints, TRY...CATCH with THROW and RAISERROR, and XACT_ABORT with XACT_STATE for transactions that can no longer commit.

    1. T-SQL transactions, @@TRANCOUNT and savepoints Intermediate Free lesson, Pro answers: 10 minutes
    2. T-SQL TRY...CATCH, THROW and RAISERROR Intermediate Free core, Pro depth: 4 of 10 minutes free
    3. XACT_ABORT, XACT_STATE and doomed transactions Intermediate Free core, Pro depth: 3 of 10 minutes free
  4. Module 4

    Working with sets: temporary tables, MERGE and cursors

    Local and global temporary tables, table variables and table-valued parameters, MERGE with OUTPUT for safe upserts, and cursors rewritten as set-based code.

    1. T-SQL temporary tables: #local and ##global Intermediate Free lesson, Pro answers: 15 minutes
    2. Table variables and table-valued parameters Intermediate Free core, Pro depth: 5 of 15 minutes free
    3. T-SQL MERGE, OUTPUT and safe upserts Intermediate Free core, Pro depth: 4 of 10 minutes free
    4. T-SQL cursors and set-based rewrites Intermediate Free core, Pro depth: 6 of 15 minutes free
  5. Module 5

    Window functions in T-SQL

    Ranking and offset functions, then window frames, the default frame and running totals that stay correct with ties.

    1. T-SQL ranking and offset window functions Intermediate Free lesson, Pro answers: 20 minutes
    2. T-SQL window frames and running totals Intermediate Free core, Pro depth: 7 of 20 minutes free
  6. Module 6

    Dynamic SQL and triggers in T-SQL

    Dynamic SQL with sp_executesql, bound parameters and QUOTENAME, and triggers with the inserted and deleted tables and the pitfalls of multi-row changes.

    1. Dynamic SQL with sp_executesql, safely Intermediate Free lesson, Pro answers: 10 minutes
    2. T-SQL triggers: inserted, deleted and pitfalls Intermediate Free core, Pro depth: 5 of 15 minutes free
  7. Module 7

    Execution plans and performance in SQL Server

    Reading estimated and actual execution plans, parameter sniffing, parameter-sensitive plans and Query Store.

    1. Reading SQL Server execution plans Intermediate Free lesson, Pro answers: 10 minutes
    2. Parameter sniffing, PSP and Query Store Advanced Free core, Pro depth: 5 of 15 minutes free
  8. Module 8

    Production T-SQL: concurrency, security, new features and tests

    Locking, RCSI and deadlocks, permissions and ownership chains, JSON and regular expressions in SQL Server 2025, tests with tSQLt, and code review drills.

    1. Locking, RCSI and deadlocks in SQL Server Advanced Free lesson, Pro answers: 15 minutes
    2. Security for T-SQL code: permissions and chains Advanced Free core, Pro depth: 6 of 15 minutes free
    3. SQL Server 2025: JSON, regex and new functions Intermediate Free core, Pro depth: 4 of 10 minutes free
    4. Testing T-SQL: tSQLt, CI and safe deployments Intermediate Free core, Pro depth: 6 of 15 minutes free
    5. T-SQL code review and interview drills Advanced Free core, Pro depth: 6 of 15 minutes free
  9. Module 9

    PL/SQL foundations: blocks, types, SQL and exceptions

    Anonymous blocks, variables and data types, control structures and iterators, SELECT INTO and DML inside PL/SQL, and how exceptions propagate.

    1. PL/SQL blocks, variables and data types Beginner Free lesson, Pro answers: 25 minutes
    2. PL/SQL control structures and iterators Beginner Free core, Pro depth: 7 of 20 minutes free
    3. SQL inside PL/SQL: SELECT INTO and DML Beginner Free core, Pro depth: 7 of 20 minutes free
    4. PL/SQL exceptions and how they propagate Intermediate Free core, Pro depth: 7 of 20 minutes free
  10. Module 10

    Cursors, collections and bulk processing

    Explicit cursors and cursor FOR loops, records and collections, BULK COLLECT with LIMIT, and FORALL with SAVE EXCEPTIONS and DML error logging.

    1. Explicit cursors and cursor FOR loops Intermediate Free lesson, Pro answers: 15 minutes
    2. PL/SQL records and collections Intermediate Free core, Pro depth: 5 of 15 minutes free
    3. BULK COLLECT with LIMIT Intermediate Free core, Pro depth: 5 of 15 minutes free
    4. FORALL, SAVE EXCEPTIONS and DML error logging Intermediate Free core, Pro depth: 8 of 25 minutes free
  11. Module 11

    Subprograms, packages and robust error logging

    Procedures and functions with parameter modes, cursor variables that return result sets, packages and session state, error logging with backtraces, and dependencies.

    1. PL/SQL procedures, functions and parameters Intermediate Free lesson, Pro answers: 15 minutes
    2. PL/SQL packages, session state and ORA-04068 Intermediate Free core, Pro depth: 7 of 20 minutes free
    3. Error logging, backtraces and autonomous logs Intermediate Free core, Pro depth: 5 of 15 minutes free
    4. Dependencies, compilation and warnings Advanced Free core, Pro depth: 6 of 15 minutes free
  12. Module 12

    Triggers in Oracle

    Row, statement and INSTEAD OF triggers, then compound triggers and the mutating-table error they avoid.

    1. Oracle DML triggers: row, statement, INSTEAD OF Intermediate Free lesson, Pro answers: 10 minutes
    2. Compound triggers and the mutating-table error Advanced Free core, Pro depth: 6 of 15 minutes free
  13. Module 13

    Dynamic SQL and security in PL/SQL

    EXECUTE IMMEDIATE and DBMS_SQL with bind variables and DBMS_ASSERT, and definer's rights, invoker's rights and roles.

    1. Dynamic SQL in PL/SQL without injection Intermediate Free lesson, Pro answers: 15 minutes
    2. Definer's rights, invoker's rights and roles Advanced Free core, Pro depth: 6 of 15 minutes free
  14. Module 14

    Performance: plans, PL/SQL called from SQL and table functions

    Execution plans with DBMS_XPLAN, the cost of calling PL/SQL from SQL and how to cut it, and pipelined table functions and SQL macros.

    1. Oracle execution plans with DBMS_XPLAN Intermediate Free core, Pro depth: 7 of 20 minutes free
    2. PL/SQL functions in SQL: avoiding the slowdown Advanced Free core, Pro depth: 6 of 15 minutes free
    3. Pipelined table functions and SQL macros Advanced Free core, Pro depth: 6 of 15 minutes free
  15. Module 15

    Production PL/SQL: staging, concurrency, JSON and tests

    Staging with temporary tables and MERGE, row locks, SKIP LOCKED and scheduler jobs, JSON in PL/SQL, tests with utPLSQL in CI, and code review drills.

    1. Staging in Oracle: temporary tables and MERGE Intermediate Free core, Pro depth: 9 of 25 minutes free
    2. Row locks, SKIP LOCKED and scheduler jobs Advanced Free core, Pro depth: 7 of 20 minutes free
    3. JSON in PL/SQL: object types and 26ai features Intermediate Free core, Pro depth: 8 of 20 minutes free
    4. Testing PL/SQL: utPLSQL, CI and coverage Intermediate Free core, Pro depth: 5 of 15 minutes free
    5. PL/SQL code review and interview drills Advanced Free core, Pro depth: 5 of 15 minutes free
  16. Module 16

    Across both engines: porting and concurrency

    Porting code between PL/SQL and T-SQL construct by construct, and how the two engines differ in locking, versioning and isolation.

    1. Porting code between PL/SQL and T-SQL Advanced Free core, Pro depth: 6 of 15 minutes free
    2. Oracle vs SQL Server: reads, locks and deadlocks Advanced Free core, Pro depth: 10 of 25 minutes free

Related tools

Official documentation

More in Programming languages

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.