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.

Solution: Query information from a database

Solution: Query information from a database - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2022

Solution: Query information from a database

(upbeat music) - [Presenter] In this challenge, we are given a table of some maintenance requests for a residential repair company, and we need to retrieve some of the information. So we're going to just start by selecting everything from the table, just so I can see what we have to work with. So we'll SELECT * FROM MaintenanceRequests, and I'll test my code to see what we have. So here are the different columns of data and all the rows from the table that we can work with. So we have all of these different columns. Now, the challenge is asking us for a specific subset of columns, so I don't want to return everything. I just want to retrieve the TenantName column, (keys typing) and I'll just put these in here one at a time on each line. The next one was IssueDescription. (keys typing) We wanted the CompletionDate, (keys typing) the CostEstimate, (keys typing) and the BillingStatus columns, (keys typing) So fill in all of those in the SELECT statement, we'll run it again, and this time…

Contents