0
0
MySQLquery~5 mins

Selecting specific columns in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ASELECT email FROM users;
BSELECT * FROM users;
CSELECT users FROM email;
DSELECT email, users;
What does the asterisk (*) mean in a SELECT statement?
ASelect no columns
BSelect only one column
CSelect all columns
DSelect columns with * in their name
How would you select the columns 'first_name' and 'last_name' from a table 'employees'?
ASELECT first_name last_name FROM employees;
BSELECT employees FROM first_name, last_name;
CSELECT * FROM employees WHERE first_name, last_name;
DSELECT first_name, last_name FROM employees;
If you want to see columns in a different order, what should you do?
AUse ORDER BY clause
BList columns in the desired order in the SELECT statement
CChange the table structure
DYou cannot change column order
Why is it better to select only needed columns?
ATo improve query speed and reduce data size
BTo confuse users
CTo delete other columns
DTo rename columns automatically
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.