Introduction To T-SQL Querying
Introduction To T-SQL Querying
Introduction To T-SQL Querying
Introducing T-SQL
Understanding Sets
Understanding Predicate Logic
• Understanding the Logical Order of Operations in
SELECT Statements
Lesson 1: Introducing T-SQL
About T-SQL
Categories of T-SQL Statements
T-SQL Language Elements
T-SQL Language Elements: Predicates and Operators
T-SQL Language Elements: Functions
T-SQL Language Elements: Variables
T-SQL Language Elements: Expressions
T-SQL Language Elements: Control of Flow, Errors, and
Transactions
T-SQL Language Elements: Comments
T-SQL Language Elements: Batch Separators
About T-SQL
• SQL is declarative
• Describe what you want, not the individual steps
Categories of T-SQL Statements
Arithmetic Operators *, /, %, +, -,
Concatenation +
T-SQL Language Elements: Functions
• BEGIN
• IF … ELSE • TRY
TRANSACTION
• WHILE • CATCH
• ROLLBACK
• BREAK • THROW
TRANSACTION
• CONTINUE
• COMMIT
• BEGIN … END
TRANSACTION
• WAITFOR
• ROLLBACK WORK
• SAVE
TRANSACTION
/*
All the text in this paragraph will be treated as
comments by SQL Server.
*/
USE TSQL;
Logon Information
Virtual machine: 20761C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd
• Review Question(s)