0% found this document useful (0 votes)
89 views7 pages

MS 20761C: Querying Data With Transact-SQL

This document provides an outline for a 5-day training course titled "MS 20761C: Querying Data with Transact-SQL". The course is designed to teach students how to query data with T-SQL and prepare for exam 70-761. It covers topics such as basic T-SQL querying, joins, built-in functions, grouping and aggregating data, and modifying data with DML. The course contains 9 modules that progress from basic concepts to more advanced querying techniques.

Uploaded by

hgtun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views7 pages

MS 20761C: Querying Data With Transact-SQL

This document provides an outline for a 5-day training course titled "MS 20761C: Querying Data with Transact-SQL". The course is designed to teach students how to query data with T-SQL and prepare for exam 70-761. It covers topics such as basic T-SQL querying, joins, built-in functions, grouping and aggregating data, and modifying data with DML. The course contains 9 modules that progress from basic concepts to more advanced querying techniques.

Uploaded by

hgtun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

MS 20761C: Querying Data with

Transact-SQL

Days: 5
Prerequisites: Working knowledge of databases and basic knowledge of Microsoft Windows operating
systems and its core functionality.
Audience: This course is intended for Database Administrators, Database Developers, and Business
Intelligence professionals.
The course is designed for SQL power users who aren’t necessarily database-focused; namely, report
writers, business analysts and client application developers
Description: This course is designed to introduce students to Transact-SQL. It is designed in such a way that
the first three days can be taught as a course to students requiring the knowledge for other courses in the
SQL Server curriculum. Days 4 & 5 teach the remaining skills required to take exam 70-761.

OUTLINE:

MODULE 1: INTRODUCTION TO MICROSOFT MODULE 2: INTRODUCTION TO T-SQL


SQL SERVER 2016 QUERYING
This module introduces SQL Server, the versions This module introduces the elements of T-SQL
of SQL Server, including cloud versions, and how and their role in writing queries, describes the
to connect to SQL Server using SQL Server use of sets in SQL Server, describes the use of
Management Studio. predicate logic in SQL Server, and describes the
logical order of operations in SELECT statements.
LESSONS
 The Basic Architecture of SQL LESSONS
Server  Introducing T-SQL
 SQL Server Editions and Versions  Understanding Sets
 Getting Started with SQL Server  Understanding Predicate Logic
Management Studio  Understanding the Logical Order of
LAB: WORKING WITH SQL SERVER 2016 Operations in SELECT statements
TOOLS LAB: INTRODUCTION TO TRANSACT-SQL
After completing this module, you will be able to: QUERYING
 Describe the architecture and After completing this module, you will be able to:
editions of SQL Server 2012.  Describe the elements of T-SQL and
 Work with SQL Server their role in writing queries
Management Studio.  Describe the use of sets in SQL
Server
 Describe the use of predicate logic
in SQL Server
 Describe the logical order of
operations in SELECT statements

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
MODULE 3: WRITING SELECT QUERIES MODULE 5: SORTING AND FILTERING DATA
This module introduces the fundamentals of the This module explains how to enhance queries to
SELECT statement, focusing on queries against a limit the rows they return, and to control the
single table. order in which the rows are displayed. The
module also discusses how to resolve missing and
LESSONS unknown results.
 Writing Simple SELECT Statements
 Eliminating Duplicates with LESSONS
DISTINCT  Sorting Data
 Using Column and Table Aliases  Filtering Data with Predicates
 Writing Simple CASE Expressions  Filtering with the TOP and OFFSET-
FETCH Options
LAB: WRITING BASIC SELECT STATEMENTS  Working with Unknown Values
After completing this module, you will be able to:
LAB: SORTING AND FILTERING DATA
 Write simple SELECT statements. After completing this module, you will be able to:
 Eliminate duplicates using the
DISTINCT clause.  Filter data with predicates in the
 Use column and table aliases. WHERE clause.
 Write simple CASE expressions.  Sort data using ORDER BY.
 Filter data in the SELECT clause with
MODULE 4: QUERYING MULTIPLE TABLES TOP.
This module explains how to write queries which  Filter data with OFFSET and FETCH.
combine data from multiple sources in SQL
Server. The module introduces the use of JOINs in MODULE 6: WORKING WITH SQL SERVER
T-SQL queries as a mechanism for retrieving 2016 DATA TYPES
data from multiple tables. This module explains the data types SQL Server
uses to store data. It introduces the many types
LESSONS of numeric and special-use data types. It also
 Understanding Joins explains conversions between data types, and
 Querying with Inner Joins the importance of type precedence.
 Querying with Outer Joins
 Querying with Cross Joins and Self LESSONS
Joins  Introducing SQL Server 2016 Data
Types
LAB: QUERYING MULTIPLE TABLES  Working with Character Data
After completing this module, you will be able to:  Working with Date and Time Data

 Describe how multiple tables may


be queried in a SELECT statement
using joins.
 Write queries that use inner joins.
 Write queries that use outer joins.
 Write queries that use self-joins
and cross joins.

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
LAB: WORKING WITH SQL SERVER 2016 DATA LAB: USING BUILT-IN FUNCTIONS
TYPES After completing this module, you will be able to:
After completing this module, you will be able to:
 Write queries with built-in scalar
 Describe numeric data types, type functions.
precedence and type conversions  Use conversion functions.
.  Use logical functions.
 Use functions that work with NULL.
 Write queries using character data
types. MODULE 9: GROUPING AND AGGREGATING
 Write queries using date and time DATA
data types. This module introduces methods for grouping
MODULE 7: USING DML TO MODIFY DATA data within a query, aggregating the grouped
data and filtering groups with HAVING. The
This module describes the use of Transact-SQL module is designed to help the student grasp
Data Manipulation Language to perform inserts,
why a SELECT clause has restrictions placed upon
updates, and deletes to your data.
column naming in the GROUP BY clause as well
LESSONS as which columns may be listed in the SELECT
clause.
 Inserting Data
 Modifying and Deleting Data LESSONS
LAB: USING DML TO MODIFY DATA  Using Aggregate Functions
 Using the GROUP BY Clause
After completing this module, you will be able to:
 Filtering Groups with HAVING
 Insert new data into your tables.
LAB: GROUPING AND AGGREGATING DATA
 Update and delete existing records
in your tables. After completing this module, you will be able to:

MODULE 8: USING BUILT-IN FUNCTIONS  Write queries which summarize


data using built-in aggregate
This module introduces the use of functions that
functions.
are built in to SQL Server Denali, and will discuss
 Use the GROUP BY clause to
some common usages including data type arrange rows into groups.
conversion, testing for logical results and  Use the HAVING clause to filter out
nullability. groups based on a search
condition.
LESSONS
 Writing Queries with Built-In MODULE 10: USING SUBQUERIES
Functions This module will introduce the use of subqueries
 Using Conversion Functions in various parts of a SELECT statement. It will
 Using Logical Functions include the use of scalar and multi-result
 Using Functions to Work with NULL subqueries, and the use of the IN and EXISTS
operators.

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
LESSONS LAB: USING SET OPERATORS
 Writing Self-Contained Subqueries  Writing Queries That Use UNION
 Writing Correlated Subqueries Set Operators and UNION ALL
 Using the EXISTS Predicate with  Writing Queries That Use CROSS
Subqueries APPLY and OUTER APPLY
Operators
LAB: USING SUBQUERIES  Writing Queries That Use the
After completing this module, you will be able to: EXCEPT and INTERSECT Operators
After completing this module, students will be
 Describe the uses of queries which able to:
are nested within other queries.
 Write self-contained subqueries  Write queries that use UNION to
which return scalar or multi-valued combine input sets.
results.  Write queries that use UNION ALL
 Write correlated subqueries which to combine input sets
return scalar or multi-valued results.  Write queries that use the EXCEPT
 Use the EXISTS predicate to operator to return only rows in one
efficiently check for the existence of set but not another.
rows in a subquery.  Write queries that use the
INTERSECT operator to return only
MODULE 11: USING SET OPERATORS rows that are present in both sets
This module introduces the set operators UNION,  Write queries using the CROSS
INTERSECT, and EXCEPT to compare rows APPLY operator.
between two input sets.  Write queries using the OUTER
APPLY operator
LESSONS
MODULE 13: USING WINDOWS RANKING,
 Writing Queries with the UNION OFFSET, AND AGGREGATE FUNCTIONS
Operator
This module describes the benefits to using
 Using EXCEPT and INTERSECT
window functions. Restrict window functions to
 Using APPLY
rows defined in an OVER clause, including
LAB: USING SET OPERATORS partitions and frames. Write queries that use
After completing this module, you will be able to: window functions to operate on a window of
rows and return ranking, aggregation, and offset
 Write queries using UNION, comparison results.
EXCEPT, and INTERSECT operators.
 Use the APPLY operator. LESSONS
 Creating Windows with OVER
MODULE 12: USING SET OPERATORS  Exploring Window Functions
This module introduces how to use the set
operators UNION, INTERSECT, and EXCEPT to LAB: USING WINDOWS RANKING, OFFSET,
compare rows between two input sets. AND AGGREGATE FUNCTIONS
 Writing Queries that use Ranking
LESSONS Functions
 Writing Queries with the UNION  Writing Queries that use Offset
operator Functions
 Using EXCEPT and INTERSECT  Writing Queries that use Window
 Using APPLY Aggregate Functions

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
After completing this module, students will be After completing this module, students will be
able to: able to:
 Describe the T-SQL components  Describe how pivoting data can be
used to define windows, and the used in T-SQL queries.
relationships between them.  Write queries that pivot data from
 Write queries that use the OVER rows to columns using the PIVOT
clause, with partitioning, ordering, operator.
and framing to define windows  Write queries that unpivot data
 Write queries that use window from columns back to rows using the
aggregate functions. UNPIVOT operator.
 Write queries that use window  Write queries using the GROUPING
ranking functions. SETS subclause.
 Write queries that use window  Write queries that use ROLLUP
offset functions AND CUBE.
 Write queries that use the
MODULE 14: PIVOTING AND GROUPING SETS GROUPING_ID function.
This module describes write queries that pivot
and unpivot result sets. Write queries that specify MODULE 15: EXECUTING STORED
multiple groupings with grouping sets PROCEDURES
This module describes how to return results by
LESSONS executing stored procedures. Pass parameters to
 Writing Queries with PIVOT and procedures. Create simple stored procedures
UNPIVOT that encapsulate a SELECT statement. Construct
 Working with Grouping Sets and execute dynamic SQL with EXEC and
sp_executesql.
LAB: PIVOTING AND GROUPING SETS
 Writing Queries that use the PIVOT LESSONS
Operator  Querying Data with Stored
 Writing Queries that use the Procedures
UNPIVOT Operator  Passing Parameters to Stored
 Writing Queries that use the procedures
GROUPING SETS CUBE and  Creating Simple Stored Procedures
ROLLUP Subclauses  Working with Dynamic SQL
LAB: EXECUTING STORED PROCEDURES
 Using the EXECUTE statement to
Invoke Stored Procedures
 Passing Parameters to Stored
procedures
 Executing System Stored
Procedures

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
After completing this module, students will be After completing this module, students will be
able to: able to:
 Describe stored procedures and  Describe how Microsoft SQL Server
their use. treats collections of statements as
 Write T-SQL statements that batches.
execute stored procedures to return  Create and submit batches of T-
data. SQL code for execution by SQL
 Write EXECUTE statements that Server.
pass input parameters to stored  Describe how SQL Server stores
procedures. temporary objects as variables.
 Write T-SQL batches that prepare  Write code that declares and
output parameters and execute assigns variables.
stored procedures.  Create and invoke synonyms
 Use the CREATE PROCEDURE  Describe the control-of-flow
statement to write a stored elements in T-SQL.
procedure.  Write T-SQL code using IF...ELSE
 Create a stored procedure that blocks.
accepts input parameters.  Write T-SQL code that uses WHILE.
 Describe how T-SQL can be
dynamically constructed. MODULE 17: IMPLEMENTING ERROR
 Write queries that use dynamic HANDLING
SQL. This module introduces error handling for T-SQL.
MODULE 16: PROGRAMMING WITH T-SQL LESSONS
This module describes how to enhance your T-  Implementing T-SQL error handling
SQL code with programming elements.  Implementing structured exception
handling
LESSONS
 T-SQL Programming Elements LAB: IMPLEMENTING ERROR HANDLING
 Controlling Program Flow  Redirecting errors with TRY/CATCH
 Using THROW to pass an error
LAB: PROGRAMMING WITH T-SQL message back to a client
 Declaring Variables and Delimiting After completing this module, students will be
Batches able to:
 Using Control-Of-Flow Elements
 Using Variables in a Dynamic SQL  Implement T-SQL error handling.
Statement  Implement structured exception
 Using Synonyms handling.

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com
MS 20761C: Querying Data with
Transact-SQL
MODULE 18: IMPLEMENTING TRANSACTIONS
This module describes how to implement
transactions.

LESSONS
 Transactions and the database
engines
 Controlling transactions
LAB: IMPLEMENTING TRANSACTIONS
 Controlling transactions with BEGIN,
COMMIT, and ROLLBACK
 Adding error handling to a CATCH
block
After completing this module, students will be
able to:
 Describe transactions and the
differences between batches and
transactions.
 Describe batches and how they are
handled by SQL Server.
 Create and manage transactions
with transaction control language
(TCL) statements.
 Use SET XACT_ABORT to define
SQL Servers handling of
transactions outside TRY/CATCH
blocks.

Baton Rouge | Lafayette | New Orleans


www.lantecctc.com

You might also like