Efficient SELECT Statements

SQL

Avoid SELECT *

Query Efficiency: Select Only What You Need

The Problem with SELECT *

SELECT * retrieves ALL columns, even ones you don't need:

  • More data transferred
  • More memory used
  • Harder to read and maintain
  • Can break code if schema changes

    Better Practice

    Always specify the exact columns you need:

-- Instead of: SELECT * FROM users
SELECT id, username, email FROM users

Your Task

You need to create a user list showing only:

  • username, email, created_at

    Write an efficient query using only these columns (not SELECT *).

Query Editor
Loading SQL engine...
Loading...
Loading SQL engine...

Run your query to see results