Apple is rewarding employees with a special bonus. You need to calculate the bonus amount for each employee.
The bonus logic is as follows:
Write an SQL query to return the employee_id and the calculated bonus.
| employee_id(INTEGER) | name(VARCHAR) | salary(INTEGER) |
|---|---|---|
| 2 | Meir | 3000 |
| 3 | Michael | 3800 |
| 7 | Addison | 7400 |
| 8 | Juan | 6100 |
| 9 | Kiki | 7700 |
| dept_id(INTEGER) | dept_name(VARCHAR) |
|---|---|
| 1 | Engineering |
| 2 | Sales |
| employee_id(INTEGER) | dept_id(INTEGER) |
|---|---|
| 2 | 1 |
| 3 | 1 |
| 7 | 2 |
| 8 | 2 |
| 9 | 1 |
| employee_id(INTEGER) | bonus(INTEGER) |
|---|---|
| 2 | 0 |
| 3 | 0 |
| 7 | 7400 |
| 8 | 0 |
| 9 | 7700 |