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 very interesting leetcode SQL problem called User Purchase Platform . This is one of the very interesting problem that I have seen on leetcode. Do try yourself first. Below is the create and insert script: create table spending ( user_id int, spend_date date, platform varchar(10), amount int ); insert into spending values(1,'2019-07-01','mobile',100),(1,'2019-07-01','desktop',100),(2,'2019-07-01','mobile',100) ,(2,'2019-07-02','mobile',100),(3,'2019-07-01','desktop',100),(3,'2019-07-02','desktop',100); /* User purchase platform. -- The table logs the spendings history of users that make purchases from an online shopping website which has a desktop and a mobile application. -- Write an SQL query to find the total number of users and the total amount spent using mobile only, desktop only and both mobile and desktop together for each date. */