Last answered:

23 Mar 2022

Posted on:

19 Feb 2022

0

Margareta Markovitch has 2 titles

what should be the sql query to find who have change in their title in different time period?

1 answers ( 0 marked as helpful)
Instructor
Posted on:

23 Mar 2022

0

Hi Abrar!
Thanks for reaching out.

You can use the following code:

SELECT
    e.first_name, e.last_name, COUNT(t.title) AS cnt
FROM
    employees e
        JOIN
    titles t ON e.emp_no = t.emp_no
    GROUP BY e.emp_no
HAVING
    cnt > 1;

Hope this helps.
Best,
Tsvetelin

Submit an answer