Recall & Review
beginner
What does the SQL SELECT statement do?
The SELECT statement retrieves data from a database table. You can choose to get all columns or specific columns.
Click to reveal answer
beginner
How do you select only the 'name' and 'age' columns from a table called 'people'?
Use:
SELECT name, age FROM people; This gets only the 'name' and 'age' columns from the 'people' table.Click to reveal answer
beginner
What happens if you use
SELECT * in a query?The
* means 'all columns'. So, SELECT * returns every column in the table.Click to reveal answer
beginner
Can you select columns in any order you want?
Yes! You can list columns in any order in the SELECT statement. The result will show columns in that order.
Click to reveal answer
beginner
Why might you want to select specific columns instead of all columns?
Selecting specific columns can make queries faster and results easier to read. It also reduces data sent over the network.
Click to reveal answer
Which SQL query selects only the 'email' column from the 'users' table?
✗ Incorrect
Only option D correctly selects the 'email' column from the 'users' table.
What does the asterisk (*) mean in a SELECT statement?
✗ Incorrect
The asterisk (*) means to select all columns from the table.
How would you select the columns 'first_name' and 'last_name' from a table 'employees'?
✗ Incorrect
Option D correctly lists the columns separated by a comma after SELECT.
If you want to see columns in a different order, what should you do?
✗ Incorrect
You control the order of columns in the result by listing them in that order in the SELECT statement.
Why is it better to select only needed columns?
✗ Incorrect
Selecting only needed columns makes queries faster and results smaller.
Explain how to select specific columns from a table in SQL.
Think about the basic structure of a SELECT query.
You got /3 concepts.
Why might you choose to select specific columns instead of all columns?
Consider what happens when you get too much data.
You got /3 concepts.