Lowest and Highest Salary
EasySQLDatabaseSorting
Description
Write a SQL query to return the minimum salary as lo and the maximum salary as hi from the employees table. **Output columns (in order):** lo, hi
Table:
employees| Column | Type |
|---|---|
| id | INT |
| salary | INT |
Examples
Input:
CREATE TABLE employees (id INT, salary INT); INSERT INTO employees VALUES (1,30000),(2,90000),(3,50000);Output:
30000|90000Explanation:
Taking the smallest and largest salary in one pass returns the pay range endpoints.
Input:
CREATE TABLE employees (id INT, salary INT); INSERT INTO employees VALUES (1,42000);Output:
42000|42000Explanation:
Taking the smallest and largest salary in one pass returns the pay range endpoints.
Input:
CREATE TABLE employees (id INT, salary INT); INSERT INTO employees VALUES (1,100),(2,100),(3,100);Output:
100|100Explanation:
Taking the smallest and largest salary in one pass returns the pay range endpoints.
Constraints
- •
Use standard SQL (SQLite).