Basics · Lesson 2 of 19

Selecting Specific Columns

The asterisk (*) grabs everything, but usually you only want specific columns.

List the exact columns you need:

SELECT first_name, salary FROM employees;

Benefits:

  • Faster queries (less data to fetch)
  • Cleaner results
  • Better for reports

Separate column names with commas.

Check your understanding

Get only the first_name and salary columns from employees.

Examples run on the employees sample database. Open any of them in the playground to experiment.

Practice it on a real question

All SELECT & filtering questions

Practice on your iPhone

Query Dojo for iPhone has 85 interview questions, timed mock interviews and a tile builder, so you can write queries without a keyboard.

Get the app