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.

Retrieve records with SELECT

Retrieve records with SELECT

- [Man] The next SQL statement that I want to introduce you to is the SELECT statement. This one is probably the most common that you'll write, and it's for pulling data out of the database and asking questions about your data. The SELECT statement is literally a database query, and it's where structured query language gets its name from. Let's start by opening a new query window. Then I'll type out the keyword, SELECT. We follow this with a list of the columns that you want to retrieve in the order that you want them to appear in the results. Let's write a query that reviews our customer data. I can review it over here in the object explorer window. I'll just expand the customer's table and then expand the columns to see the list of columns that we can work with. Let's just run a SELECT statement that reviews all the data from all of these columns. We'll list them out after the SELECT statement in a comma separated list.…

Contents