Last answered:

16 Dec 2021

Posted on:

22 Nov 2021


Where is the logic in using COUNT(from_date) > 1 in order to count contracts number????

It seems that we have to insert a column of contract_no in the dept_empt so we can solve this task as  follows:

SELECT emp_no, count(contract_no) FROM dept_emp WHERE from_date > '2000-01-01'
GROUP BY emp_no
HAVING COUNT(contract_no) > 1
ORDER BY emp_no;

Need your explanation.

1 answers ( 0 marked as helpful)
Posted on:

16 Dec 2021


Hi Asmaa!

It does not matter which column you will use in the COUNT() function, since all columns have the same length. Actually, the table dept_emp does not have such a column manager_no. This table has 4 columns – emp_no, dept_no, from_date and to_date.

Hope this helps.

Submit an answer