Subject Matter Experts
You are trying to identify all Subject Matter Experts at Accenture. An employee is a subject matter expert if they have 8 or more years of work experience in a given domain, or if they have 12 or more years of experience across 2 different domains.
Write a query to return the employee id of all the subject matter experts.
Don't print out 103 because they only have 4 years experience. Don't print out 104 because even though they have 15 years of experience in total, it's across 3 different domains.
We have two important conditions that define whether an employee is a subject matter expert:
We can define the two scenarios using aggregated functions and in the clause, and finally, group the dataset by as required in the task:
The conditions in the clause can be interpreted as such:
Do you know why we are filtering the conditions in the HAVING clause instead of the WHERE clause?