SQL Server: Transact-SQL Basic Data Retrieval

Learn how to construct SELECT statements to retrieve data from SQL Server databases, applicable for developers from SQL Server 2005 onwards
Course info
Rating
(677)
Level
Beginner
Updated
Aug 1, 2012
Duration
3h 53m
Table of contents
Introduction
Setting Up a Transact-SQL Learning Environment
Writing a Basic SELECT Statement
Querying Multiple Data Sources
Using Functions
Description
Course info
Rating
(677)
Level
Beginner
Updated
Aug 1, 2012
Duration
3h 53m
Description

If you need to retrieve data from a SQL Server database then you need to know how to use the SELECT statement. This course starts with the basics of a SELECT statement and its various sub-clauses, and progresses to how to select from multiple data sources in the same statement and a comprehensive section on the functions available to manipulate, aggregate, and convert data during the select operation. More then fifty demos help to give you a thorough understanding of how to perform these essential operations, all using a freely-available demo environment that you're shown how to set up and configure. This course is perfect for developers who need to query SQL Server databases to retrieve data, from complete beginners through to more experienced developers who can use some of the modules as reference material. The information in the course applies to all versions from SQL Server 2005 onwards.

About the author
About the author

Joe Sack is a Principal Program Manager in the SQL Server and Azure SQL Database product team at Microsoft, with a focus on query processing. With over 19 years of experience in the industry, Joe is an author and speaker, specializing in performance tuning and optimization.

More from the author
More courses by Joe Sack
Section Introduction Transcripts
Section Introduction Transcripts

Setting Up a Transact-SQL Learning Environment
Hi, this is Joe Sack from SQLskills. com and I'm recording this course for Pluralsight. This is the SQL Server: Transact-SQL Basic Data Retrieval course and you're watching Module 2 where you learn how to setup your own Transact-SQL Learning Environment. This module will cover how to setup your own learning environment so that you can follow along with the percentage concepts and demonstrations. I definitely recommend that you practice the concepts and techniques covered in this course as this will be the best way to help reinforce your new skills. In this module, I'll walk through how to install SQL Server 2012 Express Edition. How to install SQL Server Data tools and how to download the AdventureWorks for SQL Server 2012 sample database and attach it to the SQL Server instance. And at the end of this module, I'll demonstrate executing a basic select statement, both using SQL Server Management Studio and then also SQL Server Data Tools.

Writing a Basic SELECT Statement
Hi, this is Joe Sack from sqlskills. com and I'm recording this course for Pluralsight. This is the SQL Server: Transact-SQL Basic Data Retrieval course and you're watching Module 3. We'll learn about the fundamentals of writing a SELECT statement. SQL Server is Microsoft's primary database server engine product and as of this recording, SQL Server 2012 is the latest version. Transact-SQL is Microsoft's version of the SQL ANSI-standard and it's the language to be used to interact with the SQL Server database engine. Transact-SQL is, for the most part, a declarative language. This means that the language describes what exactly we want to do but not necessarily how SQL Server should go about doing it. Be aware that there are exceptions to this behavior. For example, you can use query hints to force the query optimizer to access tables in a specific order. In that case, we're not just telling SQL Server what results we want to see but also telling SQL Server how to go about retrieving the data itself. In this module, I'll introduce you to the various query clauses that could be used in a Transact-SQL SELECT statement to facilitate data retrieval.

Querying Multiple Data Sources
Hi, this is Joe Sack from SQLskills. com and I'm recording this course for Pluralsight. This is the SQL Server Transact-SQL Basic Data Retrieval course and you're watching Module 4 where you'll learn how to query multiple data sources from a single select statement. Most data retrieval queries involve accessing multiple data sources in order to produce a single result set. The previous module laid out the fundamentals using one data source per query and now we'll build on those fundamentals by showing the various ways you can reference multiple data sources in a single query. We'll cover various join methods and also other ways to combine sets such as the UNION operator, CROSS APPLY, INTERSECT and EXCEPT and an introduction to Common Table Expressions or CTEs.

Using Functions
Hi, this is Joe Sack from SQLskills and I'm recording this course for Pluralsight. This is the SQL Server: Transact-SQL Basic Data Retrieval course and you're watching Module 5 where you'll learn about various built-in functions that you can use in your SELECT statements. SQL Server includes several built-in functions you can use for your data retrieval queries and in this module, you'll learn about the more common and useful built-in functions and you'll also learn how to use them. I'll cover aggregate, mathematical, ranking, conversion, date and time, logical strings and analytic functions, as well as discuss considerations around handling nulls.