From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 24,100 courses taught by industry experts.

Solution: Query data in a database

Solution: Query data in a database

(upbeat music) - [Instructor] In this challenge, we're given a table of products sold by a coffee roaster, and we need to produce a query that retrieves just the information of interest to the shipping department manager. And we can start by saying SELECT, that's our keyword to grab columns from a data table. And I'll use the shortcut SELECT *, which will just mean to grab all of the columns and then we specify where they're coming from. So from the ProductCatalog table. We'll finish our statement with a semicolon at the end. And if I test it out, we'll see everything that's in that ProductCatalog table and we can see that it returns a total of 12 columns. Now the challenge says that we are only interested in getting the columns that are needed by the shipping department manager. So we can see there's lots of information here, including the product category and the brand, the description, the shipping manager doesn't care about any of that information. They just want to see what's in…

Contents