Skip to content

Correction of the question tense #33

@M-Matin-dev

Description

@M-Matin-dev

* Show me all the employees that have had more than 15 salary changes that work in the department development

Please change the question to Show me all the employees that have had more than 15 salary changes and have ever worked in the department development

The original sentence conveys showing the employees that are currently working in the "Development" department which is not the intended result and need an extra de.to_date > NOW() condition:

SELECT e.emp_no, count(s.from_date) as "amount of raises"
FROM employees as e
JOIN salaries as s USING(emp_no)
JOIN dept_emp AS de USING(emp_no)
WHERE de.to_date > NOW() And de.dept_no = 'd005'
GROUP BY e.emp_no
HAVING count(s.from_date) > 15
ORDER BY e.emp_no;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions