This video provides you with the knowledge to write SELECT statements to retrieve data from a SQL Server database. The video begins with an explanation of fields and records, followed by the anatomy of a SELECT statement. It continues with how to use a WHERE clause to filter specific records into the result set. Since a field can store various data types, the filter section shows how to work with those data types. Finally, there is coverage of how to sort and order a result set.
Also covered is the four-part naming convention for tables in SQL Server. A proper understanding of table naming is important as queries become more involved and complex. Table and column aliases are covered as well, which are names that you can provide as substitutes for canonical names that are often long and cumbersome. Aliases provide a level of insulation in your queries from changes to names in the tables and columns that are being queried.
While this video is about T-SQL and includes examples specific to SQL Server, the bulk of what you will learn is applicable to any vendor's implementation of the SQL language.
What You Will Learn
- Query and retrieve data from a SQL Server database
- Understand the basic structure of a SELECT statement
- Filter query results to only those records that interest you
- Sort query results in ascending or descending order
- Execute queries that answer Top N type business questions
- Properly reference tables in your queries by using all four parts of a table name
- Improve readability and maintainability through using alias names
Who This Video Is For
T-SQL Querying: Writing a SELECT Statement is aimed at business analysts, developers, and others whose career will benefit from a knowledge of the SQL language for accessing Microsoft SQL Server databases and the data they contain. The video is for anyone working in a SQL Server environment and wanting to derive business value from their organization’s data by analyzing that data, creating reports, or even generating visualizations.
Table of Contents
- Introduction 00:02:30
- Fields and Records 00:03:12
- The Anatomy of a SELECT statement 00:06:54
- The Four-Part Name of a Table 00:04:28
- Concatenation and Aliases 00:06:22
- Filter Records by a Numeric Field 00:04:53
- Filter Records by a Character Field 00:04:52
- Filter Records by a Date Field 00:05:17
- Filter Records with a NULL value 00:03:25
- Sorting Records in a SELECT statement 00:03:07
- Sorting Records by Top Values 00:03:33
- Title: T-SQL Querying: Writing a SELECT Statement
- Release date: December 2018
- Publisher(s): Apress
- ISBN: 9781484243336