Back to questions

Data Science Skills LinkedIn SQL Interview Question

Data Science Skills

LinkedIn SQL Interview Question

Given a table of candidates and their skills, you're tasked with finding the candidates best suited for an open Data Science job. You want to find candidates who are proficient in Python, Tableau, and PostgreSQL.

Write a query to list the candidates who possess all of the required skills for the job. Sort the output by candidate ID in ascending order.

Assumption:

  • There are no duplicates in the table.

Table:

Column NameType
candidate_idinteger
skillvarchar

Example Input:

candidate_idskill
123Python
123Tableau
123PostgreSQL
234R
234PowerBI
234SQL Server
345Python
345Tableau

Example Output:

candidate_id
123

Explanation

Candidate 123 is displayed because they have Python, Tableau, and PostgreSQL skills. 345 isn't included in the output because they're missing one of the required skills: PostgreSQL.

The dataset you are querying against may have different input & output - this is just an example!

p.s. give the hints below a try if you're stuck and don't know where to start!

p.p.s if you find this problem too tricky, even after the hints, check out my 30-day SQL learning roadmap, which features my favorite free resources to learn SQL! After you strengthen your SQL foundations, I'm sure you'll be more than ready to tackle this question!

Input

Output