Call for Latest Dates
Call us on 0870 7777 388 for availability on this course.
Have questions or need a better city/date? Ask now.
|
Course Overview Microsoft's Transact-SQL is the cornerstone of all SQL Server database operations. Its SELECT statement appears simple, but in fact provides tremendous power for solving difficult business problems. To take advantage of this, developers need to know how to create advanced queries. 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. Audience This course is valuable for those who are developing systems using SQL Server databases, or who are using SQL to extract and analyse data from SQL Server databases. Course 530, " SQL Server 2000 Introduction ", or Course 131, " SQL Server 2005 Introduction ", or equivalent knowledge is assumed. Skills Gained - 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
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 UNION - Eliminating duplicate results
- UNION ALL
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
- 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
How to make a booking for the MSQ-TQ course
|