
The basics
The material we cover in this module will be used throughout the course. Understanding objects and object names, the processing order of a query, literal values, identifiers and delimiters, SMSS basics, and more will be important often when you work with SQL.
Lessons
- Introducing databases
- The database table
- SQL basics
- SSMS basics
- Query basics
- The metadata
The Relational Model
Any discussion about relational databases will inevitably require an understanding of the Relational Model. The RM describes the organization and structure of the database and will have an impact on almost everything in this course and back at work. Also, understanding this important topic is the first step in understanding and applying joins.
Lessons
- Introducing the Relational Model
- The need for joins
- Table relationships
- OLAP and OLTP databases (Optional – Time permitting)
Getting the data
The FROM clause always references a table. The table can be a database table, it can be generated by table-type functions, views, subqueries or joins. In this module, our focus will be on joins and subqueries.
Lessons
- The FROM clause
- Single-join queries
- Multiple-join queries
- Derived-table Subqueries
- Old join syntax
Filtering the Data
Now that we can use the FROM clause to define the data for our query, we need a way to select what we want to include in our results and what we want to exclude. In this module, we look at different ways we can use the WHERE clause to filter the data.
Lessons
- Introduction
- Expressions
- Data type precedence
- Advanced filtering
- WHERE clause optimization
Displaying the Data
At this point, we have learned how to define the data to query using the FROM and WHERE clauses. We are ready to display the results from our query. This is where we project columns and apply any sorting of the results. We will also take advantage of this opportunity to dive a little more deeply into functions.
Lessons
- Introduction
- The column list
- The ORDER BY Clause
- Functions
- CASE expression
Aggregating the Data
All levels of management need information to provide decision support. Lower levels of management may need to make decisions about what products and how much to have in stock, and higher levels of management may need to understand industry trends to support strategic decisions about where to guide the company. In this module, you will learn how to create Aggregate queries; they provide this powerful type of high-level information.
Lessons
- Introduction
- Aggregation with GROUP BY
- Advanced aggregation
- Ranking data
Maintaining the Data
Everything we’ve seen so far in this course has been about reading the data. In this module, we look at the three write operations that we collectively call data maintenance: Insert, delete, and update. We start with a look at transactions, and we end with a look at the Merge command that allows us to perform all three data maintenance operations in one pass of the data.
Lessons
- Transactions
- Inserting data
- Deleting data
- Updating data
- Merging data
Development in TSQL
So far in this course, we’ve seen how the conceptual schema works. In this module we turn to the external schema where we can encapsulate much of what we’ve learned. We will encapsulate our age calculation, see how a stored procedure can be used to save a 1:N relationship, process transactions, perform data validation, and more.
Lessons
- Basic Programming constructs
- Scalar functions
- Views
- Inline table-valued functions
- Stored procedures | Part 1
- Stored Procedures | Part 2
- Multi-statement table-valued functions
This course is intended for SQL Server Developers, Database Administrators, and System Engineers who are responsible for writing T-SQL queries for an application.
Before attending this course, students should have:
- Familiarity with programming and developing software using any language.