From the course: Learning Microsoft SQL Server 2022
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Solution: Select data from a table - SQL Server Tutorial
From the course: Learning Microsoft SQL Server 2022
Solution: Select data from a table
- [Instructor] In this first challenge, we were tasked with reviewing some expense data about our organization. We need to retrieve records about office supply purchases and sort the data so that the most recent purchases are at the top of the results. I'll start by running the SELECT statement that we're given. That'll just select everything from the Expenses table, and we can see all the raw data that we have to work with. Includes all these different columns, and lots of different rows of data that are in this table. The first step of the challenge is to retrieve just the columns that don't include the AMOUNT column, so I want all the other columns. So, I want EXPENSEID, DATE, CATEGORY. I do not want this AMOUNT column to show in the final results, but I do want the DESCRIPTION. So, we need to modify this SELECT statement. Instead of returning all of the columns with this asterisk character, we just need to list out the columns that we do want. So, I'll say ExpenseID, comma Date…
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
-
-
-
-
-
-
(Locked)
Create a SELECT statement6m 15s
-
(Locked)
Use functions to calculate values7m 16s
-
(Locked)
Join data from multiple tables4m 54s
-
(Locked)
Write an UPDATE statement4m 37s
-
(Locked)
Add data with an INSERT statement4m 51s
-
(Locked)
Create a view of the data7m 42s
-
(Locked)
Solution: Select data from a table2m 47s
-
(Locked)
Solution: Join related tables with a query3m 11s
-
(Locked)
Solution: Use functions to calculate values4m 49s
-
(Locked)
Solution: Update the data stored in a table6m 30s
-
(Locked)
-