Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Advanced SQL

Classroom training course


2 day course outline

This course covers the following topics (any items marked with a * will be covered if time allows):

Stored procedures Deleting using SQL Derived tables and CTEs

• Creating stored procedures • Ways to drop tables • Using derived tables


• Executing stored procedures • DELETE versus TRUNCATE • Common Table Expressions (CTEs)
• System stored procedures • Multiple CTEs in a single query
Updating data in SQL
Variables Debugging (*)
• The UPDATE statement
• Declaring variables • Updating using joins • Debugging queries and procedures
• SET versus SELECT • Setting breakpoints
• Tricks with variables Inserting data
• So-called global variables Dynamic SQL (*)
• Making tables (SELECT INTO)
• Appending data (INSERT INTO) • Building up dynamic SQL
Parameters and return values
• Inserting individual rows • Executing dynamic SQL
• Passing parameters • Disadvantages of dynamic SQL
• Default values / WHERE clauses Creating tables
• Output parameters Pivots (*)
• Creating tables in SQL
• Using RETURN
• Primary keys and indexes • Assembling data for pivoting
• Adding relationships • Using PIVOT
Scalar functions
• Dynamic column headers
• What they are Transactions
• Writing user-defined functions Triggers (*)
• Beginning a transaction
• Worked examples
• Committing / rolling back • Insert, update and delete triggers
• Pros and cons of scalar functions
• Using generated tables (eg
Temporary tables and table variables INSERTED)
Testing conditions
• Using INSTEAD OF
• Scope (local versus global)
• IF / ELSE statement
• Using temporary tables
• Using CASE where possible
• Creating table variables
• Pros and cons of each approach
Looping

• Syntax of WHILE Table-valued functions (*)


• Breaking out of a loop
• In-line table-valued functions
• Mult-statement table-valued
Error-handling
functions
• Using TRY / CATCH
• System error functions
• Custom error messages

There will be no more than 5 people on the course. All of our public (scheduled) courses include lunch at a local restaurant.
For more information, see www.wiseowl.co.uk/courses/advanced-sql-training.htm.

Wise Owl Business Solutions Ltd (company number 05110386) | Tel: (0161) 883 3606 | Web: https://www.wiseowl.co.uk

You might also like