Chapter 3. Data Retrieval Using Transact-SQL Statements
The primary purpose of creating databases and tables in SQL Server is to store data and make that data available to users and application queries. Like any other Relational Database Management System (RDBMS), retrieval of data from a SQL Server database is a relatively straightforward task. In this chapter, you will learn how to get data from the databases using the Transact-SQL (T-SQL) SELECT statement. After reading through the chapter, you will be able to understand the following:
- Transact-SQL SELECT, FROM, and WHERE clauses
- Use a Transact-SQL function in a query
- Multiple table queries using UNION, EXCEPT, INTERSECT, and JOINs
- Use subqueries and CTEs to perform advanced queries
- Organizing, grouping, and pivoting data
- Use of the Transact-SQL analytic window functions
Note
This chapter contains a large number of example T-SQL queries, all of which require the
AdventureWorks2012
database, which is available for download from http...