Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction of the question tense #33

Open
M-Matin-dev opened this issue Jun 15, 2023 · 0 comments
Open

Correction of the question tense #33

M-Matin-dev opened this issue Jun 15, 2023 · 0 comments

Comments

@M-Matin-dev
Copy link

* 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;
@M-Matin-dev M-Matin-dev changed the title Clarification of the question tense Correction of the question tense Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant