Cisco, Prince2, Microsoft, ITIL & ISEB IT Training Courses – CourseMonster
To speak to a training advisor please call
Browse Microsoft Training Courses

Developing SQL Queries for Microsoft SQL Server

Course Code: 534      Days: 4
Show all Microsoft Courses
Scheduled Dates
Locations filtered. Show all UK course locations.
Request availability or book by selecting a date:
Central London
City
London (NW1) 06/04/10 £ 1,825
London (NW1) 15/06/10 £ 1,825
London (NW1) 24/08/10 £ 1,825
Prices exclude VAT.
No suitable dates?
I'd like a different date/location

Please click above and we will take care of the rest.

I’d like an onsite/bespoke course

Please click above and we will be happy to discuss the benefits of onsite and bespoke courses with you.

If suitable dates or locations are not available, click this link and we will arrange one for you

Course Overview

Microsoft's Transact-SQL is the cornerstone of all SQL Server database operations. In this hands-on course, you learn to exploit the full potential of the SELECT statement to write robust queries using the best query method for your application, test your queries, and avoid common errors and pitfalls.

This course has been classified as IT Technical Training.

Audience

Those who are developing systems using SQL Server databases, or who are using SQL to extract and analyse data from SQL Server databases. Course 131, "SQL Server 2005 Comprehensive Introduction", Course 530, "SQL Server 2000 Comprehensive Introduction", Course 925, "SQL Programming Language Introduction", or equivalent knowledge is assumed.

Skills Gained

You Will Learn How To

  • Develop complex and robust SQL queries for SQL Server 2005 and SQL Server 2000
  • Query multiple tables with inner joins, outer joins and self joins
  • Transform data with built-in functions
  • Summarise data using aggregation and grouping
  • Execute analytic functions to calculate ranks
  • Build simple and correlated subqueries

Hands-on Training

  • Learn by doing as you use Transact-SQL to solve problems and maximise performance. Instructor-led exercises include:
  • Handling NULL values in expressions and conditions
  • Coding inner and outer joins
  • Implementing self joins
  • Computing aggregate results
  • Adding subtotals and grand totals to aggregate results
  • Employing ranking and analytic functions
  • Reusing subqueries as common table expressions
  • Analysing query plans and tuning queries

Course Outline

Introduction and Overview

SQL fundamentals

  • Retrieving data with SELECT
  • Expressions
  • Literals
  • Handling NULLs properly

Executing queries

  • Analysing query plans
  • Enhancing query performance
  • Testing queries
  • Selecting the best alternatives
  • Avoiding errors and pitfalls

Querying Multiple Tables

Implementing various types of joins

  • Inner joins
  • Cross joins
  • Left, right and full outer joins
  • Equijoins vs. theta joins
  • The performance implications of joins
  • Adding filter conditions to outer joins

Writing self joins

  • Joining a table to itself
  • Chaining self joins
  • Solving time-interval problems

Combining queries with set operators

  • UNION
  • UNION ALL
  • INTERSECT
  • EXCEPT

Scalar and Aggregate Functions

Taking advantage of scalar functions

  • Converting datatypes
  • Handling dates
  • Manipulating strings
  • Choosing the right function for the job

Summarising data with aggregate functions

  • COUNT
  • SUM
  • AVG
  • MIN
  • MAX
  • Managing NULLs
  • Suppressing duplicates

Grouping data

  • GROUP BY vs. GROUP BY ALL
  • Applying conditions with HAVING
  • Calculating moving averages

Extending group queries

  • Nesting grouped aggregates
  • Joins and grouping
  • Introducing subtotals with CUBE and ROLLUP

Building crosstab reports

  • Using CASE to turn rows into columns
  • Applying PIVOT and UNPIVOT

Performing Extensive Analysis with Analytic Functions

The OVER clause

  • Specifying the ordering before applying the function
  • Splitting the result set into logical partitions

Calculating ranks

  • RANK and DENSE_RANK
  • ROW_NUMBER with ordered sets
  • Calculating percentiles

Extending the use of aggregates

  • Partitioning in multiple levels
  • Computing running totals
  • Comparing row and aggregate values

Building Subqueries

Simple subqueries

  • Subqueries in conditions and column expressions
  • Creating multilevel subqueries
  • Avoiding problems when subqueries return NULLs
  • Handling multirow subquery results

Correlated subqueries

  • Accessing values from the outer query
  • EXISTS vs. IN
  • Identifying duplicates
  • Avoiding accidental correlation

Common table expressions

  • Reusable subqueries
  • Recursive subqueries
  • Traversing hierarchies

Breaking Down Complex Queries

  • Overcoming SQL limitations
  • Reducing complexity and improving performance
  • Exploring alternatives for decomposing: tables, views, common table expressions, table-valued functions

Follow On Courses

  • 133 SQL Server Server-Side Programming with .NET and XML
  • 523 SQL Server 2005 Reporting Services
  • 535 High-Performance SQL Server Databases
  • 531 SQL Server 2000 Database Administration
  • 315 Developing User Requirements
  • 319 Technical Writing Comprehensive Introduction


How to make a booking for the 534 course

 

CourseMonster books thousands of public training courses, classes and boot camps both in London and throughout the UK including: Berkshire, Birmingham, Bristol, Bournemouth, Bucks, Cambridge, Derby, Devon, Edinburgh, Glasgow, Hampshire, Ipswich, Leeds, Leicester, Luton, Manchester, Middlesex, Milton Keynes, Norfolk, Nottingham, Reading, Surrey, Sussex, Tyne and Wear, Midlands and Yorkshire. Topics range from software to administration and development.