sqlbeginner10 minutes

Fix the Broken SELECT Query to Retrieve Employee Names

A simple SQL query intended to retrieve all employee names is not working correctly. Your task is to identify and fix the syntax errors so the query runs successfully and returns the correct results.

Challenge prompt

You have a table called Employees with columns id, name, and department. The following SQL query is intended to select all employee names, but it contains errors and does not run properly. Fix the query so it executes correctly and returns the correct list of employee names.

Guidance

  • Check for common SQL syntax issues such as missing or misplaced keywords or punctuation.
  • Ensure the SELECT statement includes the correct column name.
  • Verify the table name is spelled correctly and referenced properly.

Hints

  • SELECT queries usually start with the keyword SELECT followed by the column(s) you want to retrieve.
  • Check if commas and FROM keyword are used correctly.
  • Make sure column and table names are spelled exactly as they appear in the database.

Starter code

SELEC name FROM Employee;

Expected output

A list of all employee names from the Employees table, for example: John Doe Jane Smith Alice Johnson

Core concepts

Basic SQL syntaxSELECT statementColumn and table naming

Challenge a Friend

Send this duel to someone else and see if they can solve it.