The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Modification in Solution

Modification in Solution

Super Learner
0
Votes
1
Answer
SELECT emp_no, dept_no, COUNT(from_date) AS no_of_contracts 
FROM dept_emp WHERE from_date>'2000-01-01' 
GROUP BY emp_no
HAVING COUNT(from_date)>1 
ORDER BY emp_no;

The above query can also be used to get the actual number of contracts signed by the employees
which are greater than 1.

Is this correct?

1 Answer

365 Team
0
Votes

Hi Archisman!
Thanks for reaching out.
Yes, this is correct! In this query, you are referring still to the same single table, which is dept_emp, therefore the aggregate function only contributes to obtaining a richer output.
Thank you for sharing it with the Community!
Kind regards,
Martin

×
Complete Data Science Training
Save 60%