V.le P.A. Pirelli 6, Milano - academy@digi.it - 0269438264

Corsi Microsoft

Cerca un corso

Querying Data with Transact-SQL

Codice corso: 20761C
Durata corso: 5gg

Introduzione

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.

The main purpose of the course is to give students a good understanding of the Transact-SQL language which is used by all SQL Server-related disciplines; namely, Database Administration, Database Development and Business Intelligence. As such, the primary target audience for this course is: Database Administrators, Database Developers and BI professionals.

Obiettivi del corso

After completing this course, students will be able to:

Describe key capabilities and components of SQL Server.

Describe T-SQL, sets, and predicate logic.

Write a single table SELECT statement.

Write a multi-table SELECT statement.

Write SELECT statements with filtering and sorting.

Describe how SQL Server uses data types.

Write DML statements.

Write queries that use built-in functions.

Write queries that aggregate data.

Write subqueries.

Create and implement views and table-valued functions.

Use set operators to combine query results.

Write queries that use window ranking, offset, and aggregate functions.

Transform data by implementing pivot, unpivot, rollup and cube.

Create and implement stored procedures.

Add programming constructs such as variables, conditions, and loops to T-SQL code.

Prerequisiti

Basic knowledge of the Microsoft Windows operating system and its core functionality.
 Working knowledge of relational databases.

Struttura del Corso

MODULE 1: Introduction to Microsoft SQL Server

This module introduces SQL Server, the versions of SQL Server, including cloud versions, and how to connect to SQL Server using SQL Server Management Studio.

Lessons

After completing this module, you will be able to:

 

Describe relational databases and Transact-SQL queries

Describe the on-premise and cloud-based editions and versions of SQL Server

Describe how to use SQL Server Management Studio (SSMS) to connect to an instance of SQL Server, explore the databases contained in the instance, and work with script files that contain T-SQL queries

 

Lab : Working with SQL Server Tools

MODULE 2: Introduction to T-SQL Querying

This module describes the elements of T-SQL and their role in writing queries. 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.

Lessons

After completing this module, you will be able to:

 

Describe the role of T-SQL in writing SELECT statements

Describe the elements of the T-SQL language and which elements will be useful in writing queries

Describe the concepts of the set theory, one of the mathematical underpinnings of relational databases, and to help you apply it to how you think about querying SQL Server

Describe predicate logic and examine its application to querying SQL Server

Explain the elements of a SELECT statement

Execute Queries that Filter Data using Predicates

Execute Queries That Sort Data Using ORDER BY

Execute Basic SELECT Statements

 

Lab : Introduction to T-SQL Querying

MODULE 3: Writing SELECT Queries

This module introduces the fundamentals of the SELECT statement, focusing on queries against a single table.

Lessons

After completing this module, you will be able to:

 

Write Simple SELECT Statements

Eliminate Duplicates with DISTINCT

Use Column and Table Aliases

Write Simple CASE Expressions

Write Simple SELECT Statements

Eliminate Duplicates Using DISTINCT

Use Column and Table Aliases

Use a Simple CASE Expression

 

Lab : Writing Basic SELECT Statements

MODULE 4: Querying Multiple Tables

This module describes how to write queries that combine data from multiple sources in Microsoft SQL Server.

Lessons

After completing this module, you will be able to:

 

Explain the fundamentals of joins in SQL Server

Write Queries that use Inner Joins

Write Queries that use Multiple-Table Inner Joins

Write Queries that use Self-Joins

Write Queries that use Outer Joins

Write Queries that use Cross Joins

 

Lab : Querying Multiple Tables

MODULE 5: Sorting and Filtering Data

This module describes how to implement sorting and filtering.

Lessons

After completing this module, you will be able to:

 

Sort Data

Filter Data with Predicates

Filter Data with TOP and OFFSET-FETCH

Work with Unknown Values

Write Queries that Filter Data using a WHERE Clause

Write Queries that Sort Data Using an ORDER BY Clause

Write Queries that Filter Data Using the TOP Option

Write Queries that filter data using the OFFSET-FETCH clause

 

Lab : Sorting and Filtering Data

MODULE 6: Working with SQL Server Data Types

This module introduces the data types SQL Server uses to store data.

Lessons

After completing this module, you will be able to:

 

Introducing SQL Server Data Types

Work with Character Data

Work with Date and Time Data

Write Queries that Return Date and Time Data

Write Queries that use Date and Time Functions

Write Queries That Return Character Data

Write Queries That Return Character Functions

 

Lab : Working with SQL Server Data Types

MODULE 7: Using DML to Modify Data

This module describes how to create DML queries, and why you would want to.

Lessons

After completing this module, you will be able to:

 

Use INSERT and SELECT INTO statements

Use UPDATE, MERGE, DELETE, and TRUNCATE

 

Lab : Using DML to Modify Data

MODULE 8: Using Built-In Functions

This module introduces some of the many built in functions in SQL Server.

Lessons

After completing this module, you will be able to:

 

Write Queries with Built-In Functions

Use Conversion Functions

Use Logical Functions

Use Using Functions to Work with NULL

Write Queries That Use Conversion Functions

Write Queries that use Logical Functions

Write Queries that Test for Nullability

 

Lab : Using Built-In Functions

MODULE 9: Grouping and Aggregating Data

This module describes how to use aggregate functions.

Lessons

After completing this module, you will be able to:

 

Use Aggregate Functions

Use the GROUP BY Clause

Filter Groups with HAVING

Write Queries That Use the GROUP BY Clause

Write Queries that Use Aggregate Functions

Write Queries that Use Distinct Aggregate Functions

Write iting Queries that Filter Groups with the HAVING Clause

 

Lab : Grouping and Aggregating Data

MODULE 10: Using Subqueries

This module describes several types of subquery and how and when to use them.

Lessons

After completing this module, you will be able to:

 

Write Self-Contained Subqueries

Write Correlated Subqueries

Use the EXISTS Predicate with Subqueries

Write Queries That Use Self-Contained Subqueries

Write Queries That Use Scalar and Multi-Result Subqueries

Write Queries That Use Correlated Subqueries and an EXISTS Clause

 

Lab : Using Subqueries

MODULE 11: Using Table Expressions

Previously in this course, you learned about using subqueries as an expression that returned results to an outer calling query. Like subqueries, table expressions are query expressions, but table expressions extend this idea by allowing you to name them and to work with their results as you would work with data in any valid relational table. Microsoft SQL Server supports four types of table expressions: derived tables, common table expression (CTEs), views, and inline table-valued functions (TVFs). In this module, you will learn to work with these forms of table expressions and learn how to use them to help create a modular approach to writing queries.

Lessons

After completing this module, you will be able to:

 

Use Views

Use Inline Table-Valued Functions

Use Derived Tables

Use Common Table Expressions

Write Queries That Use Views

Write Queries That Use Derived Tables

Write Queries That Use Common Table Expressions (CTEs)

Write Queries That Use Inline Table-Valued Expressions (TVFs)

 

Lab : Using Table Expressions

 

MODULE 12: Using Set Operators

This module introduces how to use the set operators UNION, INTERSECT, and EXCEPT to compare rows between two input sets.

Lessons

After completing this module, students will be able to:

 

Write queries that use UNION to combine input sets.

Write queries that use UNION ALL to combine input sets

Write queries that use the EXCEPT operator to return only rows in one set but not another.

Write queries that use the INTERSECT operator to return only rows that are present in both sets

Write queries using the CROSS APPLY operator.

Write queries using the OUTER APPLY operator

 

Lab : Using Set Operators

MODULE 13: Using Windows Ranking, Offset, and Aggregate Functions

This module describes the benefits to using window functions. Restrict window functions to rows defined in an OVER clause, including partitions and frames. Write queries that use window functions to operate on a window of rows and return ranking, aggregation, and offset comparison results.

Lessons

After completing this module, students will be able to:

 

Describe the T-SQL components used to define windows, and the relationships between them

Write queries that use the OVER clause, with partitioning, ordering, and framing to define windows

Write queries that use window Aggregate Functions

Write queries that use window Ranking Functions

Write queries that use window Offset Functions

 

Lab : Using Windows Ranking, Offset, and Aggregate Functions

MODULE 14: Pivoting and Grouping Sets

This module describes write queries that pivot and unpivot result sets. Write queries that specify multiple groupings with grouping sets

Lessons

After completing this module, students will be able to:

 

Describe how pivoting data can be used in T-SQL queries

Write queries that pivot data from rows to columns using the PIVOT operator

Write queries that unpivot data from columns back to rows using the UNPIVOT operator

Write queries using the GROUPING SETS subclause

Write queries that use ROLLUP AND CUBE

Write queries that use the GROUPING_ID function

 

Lab : Pivoting and Grouping Sets

MODULE 15: Executing Stored Procedures

This module describes how to return results by executing stored procedures. Pass parameters to procedures. Create simple stored procedures that encapsulate a SELECT statement. Construct and execute dynamic SQL with EXEC and sp_executesql.

Lessons

After completing this module, students will be able to:

 

Querying Data with Stored Procedures

Pass Parameters to Stored procedures

Create Simple Stored Procedures

Work with Dynamic SQL

Use the EXECUTE statement to Invoke Stored Procedures

Pass Parameters to Stored procedures

Execute System Stored Procedures

 

Lab : Executing Stored Procedures

 

MODULE 16: Programming with T-SQL

This module describes how to enhance your T-SQL code with programming elements.

Lessons

After completing this module, students will be able to:

 

Describe how Microsoft SQL Server treats collections of statements as batche

Create and submit batches of T-SQL code for execution by SQL Server

Describe how SQL Server stores temporary objects as variables.

Write code that declares and assigns variables

Create and invoke synonyms

Describe the control-of-flow elements in T-SQL

Write T-SQL code using IF...ELSE blocks

Write T-SQL code that uses WHILE

 

Lab : Programming with T-SQL

MODULE 17: Implementing Error Handling

This module introduces error handling for T-SQL.

Lessons

After completing this module, students will be able to:

 

Implement T-SQL error handling.

Implement structured exception handling

Redirecting errors with TRY/CATCH

Using THROW to pass an error message back to a client

 

Lab : Implementing Error Handling

MODULE 18: Implementing Transactions

This module describes how to implement transactions.

Lessons

 

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.

Controlling transactions with BEGIN, COMMIT, and ROLLBACK

Use SET XACT_ABORT to define SQL Servers handling of transactions outside TRY/CATCH blocks.

 

Lab : Implementing Transactions

 

 

P.IVA 06249920965
C.C.I.A.A. REA: MI - 1880014
Cap. Soc. € 12.000,00

Contatti

V.le P.A. Pirelli 6,20126 Milano
Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo.
Tel.: +39 02 694 382 64
Fax.: +39 02 694 382 35

© Copyright 2020 DI.GI. Academy
Privacy Policy | Cookie Policy