logo

Back to questions

Subject Matter Experts

Easy

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.

Notes:

  • Question only asks for years of work experience across either 1 or 2 domains. You may disregard cases where an employee has years of experience in more than 2 domains.

Table:

Column NameType
employee_idinteger
domainstring
years_of_experienceinteger

Example Input:

employee_iddomainyears_of_experience
101Digital Transformation9
102Supply Chain6
102IoT7
103Change Management4
104DevOps5
104Cloud Migration5
104Agile Transformation5

Example Output:

employee_id
101
102

Explanation

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.

PostgreSQL 14

Refer friends to get bonus content & cool prizes.