Easy SELECT basics Employees database

Select every column from a table

Question

Show every column and every row of the employees table.

employeesid, name, salary, department_id, manager_id, hired_on
departmentsid, name, city

Your query

Ctrl+Enter to run

Result

Press Run to see your query's result, or Check answer to compare it with the expected result.

Expected result

idnamesalarydepartment_idmanager_idhired_on
1Tom Becker88001NULL2017-03-01
2Ana Souza65002NULL2018-06-15
3Priya Nair9200112019-01-07
4Lucas Moreau6800222020-09-21
5Mei Chen7600112021-02-01
6Omar Haddad5600222021-11-08
7Sofia Rossi61003NULL2019-05-13
8Jonas Berg5400372022-04-04
9Aisha Bello47004NULL2020-01-20
10Diego Ruiz4100492023-03-06
11Hana Kim7300112022-08-29
12Liam Walsh4300492024-01-15

Rows can come in any order. Column names do not have to match.

Hint

The star after SELECT means "all columns".

Show the solution
solution.sql Run this code
SELECT *
FROM employees;

Why it works

SELECT * returns all columns in the order they were created, and with no WHERE clause every row comes back. It is the quickest way to look at a table you do not know yet.

Common mistake

In real projects, avoid SELECT * in saved queries and reports. Name the columns you need, so the query keeps working when someone adds a column.

Want to try the query on MySQL or PostgreSQL? Open it in the SQL Online Compiler or SQLite Online.