Grokking SQL for Tech Interviews
Vote
0% completed
33. Sales Person (Easy)
Problem
Table: SalesPerson
+-----------------+---------+
| Column Name | Type |
+-----------------+---------+
| sales_id | int |
| name | varchar |
| salary | int |
| commission_rate | int |
| hire_date | date |
+-----------------+---------+
sales_id is the primary key (column with unique values) for this table.
Each row of this table indicates the name and the ID of a salesperson alongside their salary, commission rate, and hire date.
Table: Company
+-------------+---------+
| Column Name | Type |
.....
.....
.....
Like the course? Get enrolled and start learning!
Christopher Guy Slater
· 3 days ago
SELECT s.name FROM SalesPerson s WHERE NOT EXISTS ( SELECT 1 FROM Orders o JOIN Company c ON o.com_id = c.com_id WHERE s.sales_id = o.sales_id AND c.name = 'RED' )
Reading Progress
0%