Most Ask SQL interview question based on GROUP BY and HAVING clause | Select candidate for Role.
Skills:
SQL Analytics80%
Follow the video to understand how to approach SQL problems in data science interviews.
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.
Query to create the table:
CREATE TABLE IF NOT EXISTS 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'),
(345,'PostgreSQL'),
(345,'SQL Server'),
(561,'Tableau'),
(561,'PostgreSQL');
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
More on: SQL Analytics
View skill →Related AI Lessons
🎓
Tutor Explanation
DeepCamp AI