Interested in a private company training? Request it here.
Before you can get started writing T-SQL code, you must master the tool that we will mainly use throughout this classroom training: SQL Server Management Studio. But there are other useful tools as well to discover in this module:
The SELECT statement is very important in T-SQL. It allows to retrieve data from tables and views. But that data may need to be filtered, both in the rows and columns we return, and sorted. Another crucial concept discussed in this module is that of expressions, which allow us to combine multiple columns into one computed column before we return the result.
Often the data stored in the database is more detailed than the result we are interested in. This module shows how to aggregate multiple values into a group, and how to compute aggregated values on top of these groups. The following topics are covered in this module:
Most operational databases are normalized: the data is spread over multiple tables. But when building reports, we need to join these different tables to get the answer we need. That's why mastering the different techniques to combine tables in a single result is crucial. In this module we cover two important ways: via joins and via nested queries.
Each expression and each column has a datatype. It is important to be familiar with the most used types. When we use multiple datatypes in one expression, there will be an implicit conversion to on type. It is the type precedence that decides which type is being used, and this has big implications on your queris. We can also do explicit conversion between types, such that e.g. the format of the date adheres to the locale. This module goes over the important information surrounding types in T-SQL.
Sometimes there is the need to insert new data into the database. Or old data needs an update or has to be deleted. This module shows you the basics of how this can be done. The following topics are covered in this module:
This module looks at some more advanced functions and operators that you can use. These can be handy to write more advanced queries more easily. For instance, how do you retrieve for each country the three most important customers? How do you calculate the day of week from a date? How do you convert data stored in columns into rows? This module also looks into the OVER clause which has same capabilities as grouping data but with some perks.
At times you do not only need to write simple SELECT statements, but more or less "programs". This module looks into scripting in T-SQL. You will learn about special T-SQL constructs like variables and IF...ELSE statement. Often logic needs to be used multiple times at different places. For this you can create procedures and functions.
Functions and procedures are ways to abstract away logic. On top of that, functions can be used in queries and act either as scalars or tables. Two other types of abstractions are introduced in this module: views and common table expressions (CTE's). Both will be an abstraction of data and will act as a table in your queries. Notice that, in the last two modules, we only cover an introduction into these things. For a in depth coverage you better attend the Developing and optimizing SQL Server databases training.
The goal of this course is to provide students with the technical skills required to write basic Transact-SQL queries for Microsoft SQL Server. The course covers querying SQL Server 2022 or previous versions as well as Azure SQL Databases.
This course is intended for SQL Server database administrators and developers who are responsible for writing queries but have little to no experience in writing T-SQL SELECT statements.
This introductory course requires no special skills.