Exercise 1
beginnerQuestion
Select all employees with a salary greater than 50000.
Table Schema
CREATE TABLE employees (
id INT PRIMARY KEY,
name VARCHAR(100),
salary DECIMAL(10,2)
);Show Solution
Solution
1SELECT * FROM employees WHERE salary > 50000;Expected Output
| id | name | salary | |---|---|---| | 2 | Jane | 60000 | | 3 | Alice | 75000 |
Explanation
The WHERE clause filters rows based on a condition. Comparison operators include: =, <>, <, >, <=, >=