This playlist contains scenario based SQL problems. After solving these you should be able to ace any SQL interview. As and when I find a good problem, i will add it to this playlist.
Curated by: Ankit Bansal (96 videos)
In this video we are going to discuss a data analyst case study based on Advanced SQL for Analytics. This case study includes 4 problems and we are going to solve all step by step. 00:00 understand the problem 01:30 problem 1 and solution 09:15 problem 2 and 2 solutions 14:40 problem 3 and solution 17:00 problem 4 and solution Master the ART of SQL with my 0 to Hero course : https://www.namastesql.com/ Here is the ready script in case you want to try out: CREATE TABLE booking_table( Booking_id VARCHAR(3) NOT NULL ,Booking_date date NOT NULL ,User_id VARCHAR(2) NOT NULL ,Line_of_business VARCHAR(6) NOT NULL ); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b1','2022-03-23','u1','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b2','2022-03-27','u2','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b3','2022-03-28','u1','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b4','2022-03-31','u4','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b5','2022-04-02','u1','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b6','2022-04-02','u2','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b7','2022-04-06','u5','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b8','2022-04-06','u6','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b9','2022-04-06','u2','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b10','2022-04-10','u1','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b11','2022-04-12','u4','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b12','2022-04-16','u1','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b13','2022-04-19','u2','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b14','2022-04-20','u5','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b15','2022-04-22','u6','Flight'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b16','2022-04-26','u4','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b17','2022-04-28','u2','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b18','2022-04-30','u1','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b19','2022-05-04','u4','Hotel'); INSERT INTO booking_table(Booking_id,Booking_date,User_id,Line_of_business) VALUES ('b20','2022-05-06','u1','Flight'); ; CREATE TABLE user_table( User_id VARCHAR(3) NOT NULL ,Segment VARCHAR(2) NOT NULL ); INSERT INTO user_table(User_id,Segment) VALUES ('u1','s1'); INSERT INTO user_table(User_id,Segment) VALUES ('u2','s1'); INSERT INTO user_table(User_id,Segment) VALUES ('u3','s1'); INSERT INTO user_table(User_id,Segment) VALUES ('u4','s2'); INSERT INTO user_table(User_id,Segment) VALUES ('u5','s2'); INSERT INTO user_table(User_id,Segment) VALUES ('u6','s3'); INSERT INTO user_table(User_id,Segment) VALUES ('u7','s3'); INSERT INTO user_table(User_id,Segment) VALUES ('u8','s3'); INSERT INTO user_table(User_id,Segment) VALUES ('u9','s3'); INSERT INTO user_table(User_id,Segment) VALUES ('u10','s3'); Zero to hero(Advance) SQL Aggregation: https://youtu.be/5Ighj_2PGV0 Most Asked Join Based Interview Question: https://youtu.be/xR87ctOgpAE Solving 4 Trick SQL problems: https://youtu.be/Ck1gQrlS5pQ Data Analyst Spotify Case Study: https://youtu.be/-YdAIMjHZrM Top 10 SQL interview Questions: https://youtu.be/Iv9qBz-cyVA Interview Question based on FULL OUTER JOIN: https://youtu.be/KQfWd6V3IB8 Playlist to master SQL : https://youtube.com/playlist?list=PLBTZqjSKn0IeKBQDjLmzisazhqQy4iGkb Rank, Dense_Rank and Row_Number: https://youtu.be/xMWEVFC4FOk #sql #dataengineer