Use the SELECT keyword to query one or more tables and return a result consisting of selected columns and expressions. 

The following example select the FirstName and LastName for the Person table. 

SELECT FirstName, LastName FROM Person.Person;
/* Answer */
SELECT FirstName, LastName 
FROM   Person.Person 

SELECT Keyword with Expression 

Keep in mind you can use columns in formulas to create your own expressions.  Here is a query showing a person’s full name.  We do this by concatenating the FirstName to LastName. 

SELECT CONCAT(FirstName,' ',LastName) as FullName FROM Person.Person
/* Answer */
SELECT CONCAT(FirstName,' ',LastName) as FullName 
FROM   Person.Person

Processing Order 

The select keyword is used with other keyword to form complex SQL statement.  When you do this, such as combining SELECT with WHERE and GROUP BY, consider that the database processes the SELECT statement in the following order: 

  1. FROM
  2. ON
  3. JOIN
  4. WHERE
  5. GROUP BY
  6. WITH CUBE or WITH ROLLUP
  7. HAVING
  8. SELECT
  9. DISTINCT
  10. ORDER BY
  11. TOP

In summary, use the Select keyword to query a table.  When doing so, you can combine columns into expressions.  As you’re SQL skill’s development, keep in mind SELECT’s processing order, so you understand how the various clauses influence the result. 

Additional Resources 

To learn more about the IN Operator, check out these useful resources: 

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>