Description
Write a SQL query to select all columns from the employees table. Return results ordered by id ascending. **Output columns (in order):** id, name, salary, department
employees| Column | Type |
|---|---|
| id | INT |
| name | TEXT |
| salary | INT |
| department | TEXT |
Examples
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (1, 'Alice', 50000, 'Engineering'), (2, 'Bob', 60000, 'Marketing');1|Alice|50000|Engineering
2|Bob|60000|MarketingThe query returns all columns (id, name, salary, department) for all employees. Alice (id=1) from Engineering with salary 50000 appears first, followed by Bob (id=2) from Marketing with salary 60000. Results are ordered by id in ascending order.
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (5, 'Diana', 75000, 'Sales'), (1, 'John', 45000, 'HR'), (3, 'Sarah', 68000, 'Finance');1|John|45000|HR
3|Sarah|68000|Finance
5|Diana|75000|SalesSelect all columns from employees table. Note that even though data was inserted with ids 5, 1, 3, the results are ordered by id ascending (1, 3, 5) as required by the problem.
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (10, 'Michael', 90000, 'Technology');10|Michael|90000|TechnologyWith only one employee Michael (id=10) in the Technology department earning 90000, the query returns this single row. This demonstrates the query works correctly even with just one row of data.
Constraints
- •
Write a SELECT statement