Engineering High Earners
EasySQLDatabaseSorting
Description
Write a SQL query to return the name of every employee in the 'Eng' department earning more than 50000, ordered by name ascending. **Output columns (in order):** name
Table:
employees| Column | Type |
|---|---|
| id | INT |
| name | TEXT |
| salary | INT |
| department | TEXT |
Examples
Input:
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (1,'Ann',60000,'Eng'),(2,'Ben',40000,'Eng'),(3,'Cal',70000,'Sales');Output:
AnnExplanation:
Only engineers paid above the fifty-thousand mark are kept, returned in name order.
Input:
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (1,'Zoe',90000,'Eng'),(2,'Amy',55000,'Eng');Output:
Amy
ZoeExplanation:
Only engineers paid above the fifty-thousand mark are kept, returned in name order.
Input:
CREATE TABLE employees (id INT, name TEXT, salary INT, department TEXT); INSERT INTO employees VALUES (1,'P',99999,'HR'),(2,'Q',60000,'Eng');Output:
QExplanation:
Only engineers paid above the fifty-thousand mark are kept, returned in name order.
Constraints
- •
Use standard SQL (SQLite).