Course Overview
This 2-day course is intended for students who are new to querying data stored in either a Microsoft SQL Server or database, and who need a measured and relatively gentle introduction to the subject. It could also prove beneficial to delegates wanting to refresh their existing querying skills.
Applies to all version from SQL Server 2012 through to SQL Server 2022
DURATION : 2 days
INTRODUCTION
You will find that this is a comprehensive course for this level, with plenty of illustrated examples and augmented with practical hands-on exercises.
This course is also intended as a prerequisite to the 2 day “Microsoft SQL Server and Advanced Querying” course.
PREREQUISITES
Students should ideally be familiar with basic programming concepts.
They should also understand the fundamental design of relational databases including, but not restricted to, the purpose of primary and foreign keys, entity relationships, and data normalization. These prerequisites can be met by taking the 2 day “Microsoft SQL Server and Relational Database Design and Querying Fundamentals” course.
COURSE OBJECTIVES
Upon successful completion of this course, students will be able to:
• Use SQL Server Management Studio for Querying Purposes
• Understand the Basic Structure of SQL Server Databases
• Understand the Components of Transact-SQL (T-SQL)
• Retrieve Data from Tables Using the SELECT Statement
• Filter Data Using the WHERE Clause
• Sort Data Using the ORDER BY Clause
• Query Data from Multiple Tables by Using Joins
• Summarize and Group Data Using Aggregate Functions
• Combine and Limit Result Sets
• Work with Simple Nested Subqueries
• Work with Correlated Subqueries
• Add Rows of Data to a Table Using the INSERT Statement
• Remove Rows from a Table Using the DELETE Statement
• Modify Existing Rows Using the UPDATE Statement
COURSE OUTLINE
1. Introduction to SQL Server Management Studio
Identifying the Elements of SSMS Objects in a SQL Server Database
Database Diagrams
Components of a SQL Server Database Table
The Querying Environment
Creating a Script
Adding Comments to your Code Categories of SQL Statements
ANSI-SQL and Transact-SQL (T-SQL)
2. Using the SELECT Statement to Retrieve Data
Examine the Basic Syntax of the SELECT Statement
Using String Literals and Expressions
Retrieving Columns of Data from a Table
Using Aliases for Column Names
3. Filtering Rows of Data with the WHERE Clause
How to Use the WHERE Clause Overview of Operators
Filter Data by Using Comparison Operators
Filter Data by Using String Comparisons
Filter Data by Using Logical Operators
Filter Data Using a Range of Values
Filter Data Using a List of Values
Filter Data with NULL Values
Filtering Date and Time Data
4. Formatting and Sorting Result Sets
Sorting Data Using the ORDER BY
Clause Eliminating Duplicate Rows with DISTINCT
5. Querying Data from Multiple Tables Using Joins
Introduction to Joins Using
Inner Joins Using Outer Joins
Using Cross Joins
Using Aliases for Table Names
Joining More than Two Tables
6. Summarizing Data Using Aggregate Functions
Using Aggregate Functions Native to SQL Server
Using Aggregate Functions with NULL Values
Grouping Summarized Data with GROUP BY Filtering
Grouped Data Using the HAVING Clause
7. Combining and Limiting Result Sets
Combining Result Sets
Using the UNION Operator
Limiting Result Sets
Using the TOP Operator
8. Working with Subqueries
Introduction to Subqueries
Using Subqueries as Expressions and Derived Tables
Using Correlated Subqueries
Using EXISTS with Correlated Subqueries
9. Inserting Data into Tables
Inserting a Single Row into a Table
Inserting Multiple Rows into a Table
Inserting Values into Identity Columns
Differentiating Various INSERT Statements
10. Deleting Data from Tables
Deleting Rows from a Table Truncating a Table
Deleting Rows Based on Data in Other Tables
11. Updating Data in Tables
Updating Rows in a Table
Updating Rows Based on Data in Other Tables
Microsoft SQL Server Introduction To Querying 2 Days
Course Overview
This 2-day course is intended for students who are new to querying data stored in either a Microsoft SQL Server or database, and who need a measured and relatively gentle introduction to the subject. It could also prove beneficial to delegates wanting to refresh their existing querying skills.
Applies to all version from SQL Server 2012 through to SQL Server 2022
DURATION : 2 days
INTRODUCTION
You will find that this is a comprehensive course for this level, with plenty of illustrated examples and augmented with practical hands-on exercises.
This course is also intended as a prerequisite to the 2 day “Microsoft SQL Server and Advanced Querying” course.
PREREQUISITES
Students should ideally be familiar with basic programming concepts.
They should also understand the fundamental design of relational databases including, but not restricted to, the purpose of primary and foreign keys, entity relationships, and data normalization. These prerequisites can be met by taking the 2 day “Microsoft SQL Server and Relational Database Design and Querying Fundamentals” course.
COURSE OBJECTIVES
Upon successful completion of this course, students will be able to:
• Use SQL Server Management Studio for Querying Purposes
• Understand the Basic Structure of SQL Server Databases
• Understand the Components of Transact-SQL (T-SQL)
• Retrieve Data from Tables Using the SELECT Statement
• Filter Data Using the WHERE Clause
• Sort Data Using the ORDER BY Clause
• Query Data from Multiple Tables by Using Joins
• Summarize and Group Data Using Aggregate Functions
• Combine and Limit Result Sets
• Work with Simple Nested Subqueries
• Work with Correlated Subqueries
• Add Rows of Data to a Table Using the INSERT Statement
• Remove Rows from a Table Using the DELETE Statement
• Modify Existing Rows Using the UPDATE Statement
COURSE OUTLINE
1. Introduction to SQL Server Management Studio
Identifying the Elements of SSMS Objects in a SQL Server Database
Database Diagrams
Components of a SQL Server Database Table
The Querying Environment
Creating a Script
Adding Comments to your Code Categories of SQL Statements
ANSI-SQL and Transact-SQL (T-SQL)
2. Using the SELECT Statement to Retrieve Data
Examine the Basic Syntax of the SELECT Statement
Using String Literals and Expressions
Retrieving Columns of Data from a Table
Using Aliases for Column Names
3. Filtering Rows of Data with the WHERE Clause
How to Use the WHERE Clause Overview of Operators
Filter Data by Using Comparison Operators
Filter Data by Using String Comparisons
Filter Data by Using Logical Operators
Filter Data Using a Range of Values
Filter Data Using a List of Values
Filter Data with NULL Values
Filtering Date and Time Data
4. Formatting and Sorting Result Sets
Sorting Data Using the ORDER BY
Clause Eliminating Duplicate Rows with DISTINCT
5. Querying Data from Multiple Tables Using Joins
Introduction to Joins Using
Inner Joins Using Outer Joins
Using Cross Joins
Using Aliases for Table Names
Joining More than Two Tables
6. Summarizing Data Using Aggregate Functions
Using Aggregate Functions Native to SQL Server
Using Aggregate Functions with NULL Values
Grouping Summarized Data with GROUP BY Filtering
Grouped Data Using the HAVING Clause
7. Combining and Limiting Result Sets
Combining Result Sets
Using the UNION Operator
Limiting Result Sets
Using the TOP Operator
8. Working with Subqueries
Introduction to Subqueries
Using Subqueries as Expressions and Derived Tables
Using Correlated Subqueries
Using EXISTS with Correlated Subqueries
9. Inserting Data into Tables
Inserting a Single Row into a Table
Inserting Multiple Rows into a Table
Inserting Values into Identity Columns
Differentiating Various INSERT Statements
10. Deleting Data from Tables
Deleting Rows from a Table Truncating a Table
Deleting Rows Based on Data in Other Tables
11. Updating Data in Tables
Updating Rows in a Table
Updating Rows Based on Data in Other Tables