From the course: Querying Microsoft SQL Server 2022
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
The SQL querying environment - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2022
The SQL querying environment
- One of the most common database queries is to retrieve a number of records from a data table. In fact, this query is so common that the graphical interface here in Management Studio, provides this query as a menu item so that it can be executed without having to write any SQL code ourselves. Let's go into the Adventure Works Database and I'll expand the Tables folder, and here we have all the different data tables in this database. I'm going to find the one in the Human Resources schema called Department, then I'll right-click on it and choose Select Top 1000 Rows. This runs a query that asks the basic question, what data is in this table? Since, some data tables can be very large, the results on the bottom half of the screen will only display up to 1000 records that are stored in the table, if your table has that many. And these results are useful for getting a basic feel for the table's content. In this results…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is Transact SQL?3m 22s
-
(Locked)
The SQL querying environment8m 6s
-
(Locked)
Return records with SELECT and FROM8m 45s
-
(Locked)
Filter records with WHERE4m 42s
-
(Locked)
Sort records with ORDER BY2m 57s
-
(Locked)
Column aliases2m 24s
-
(Locked)
Create values with constants and math4m 22s
-
(Locked)
Challenge: Write a SELECT query1m 15s
-
(Locked)
Solution: Write a SELECT query4m 14s
-
(Locked)
Solution: Query information from a database5m 32s
-
-
-
-
-
-
-
-
-
-