Company: LinkedIn | Difficulty: easy
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.
candidates
skill
Python
Tableau
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 descending order.
candidate_id
Candidate 123 has Python, Tableau, and PostgreSQL. Candidate 234 lacks Python and PostgreSQL. Candidate 345 has Python and Tableau, but is missing PostgreSQL. Therefore, only candidate 123 is returned.
123
234
345
DROP TABLE IF EXISTS candidates; CREATE TABLE candidates (candidate_id INT, skill VARCHAR(50)); INSERT INTO candidates VALUES (123, 'Python'), (123, 'Tableau'), (123, 'PostgreSQL'), (234, 'R'), (234, 'PowerBI'), (234, 'SQL Server'), (345, 'Python'), (345, 'Tableau');
← All SQL Challenges · LinkedIn Questions · Learn SQL Free