SQL Interview Questions and answers Part 48 | SQL LEET CODE Hard Problem
Do Like ๐๐, Comment & Subscribe SQL Interview Questions and answers : The Spending table keeps the logs of 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. ------------------------------------------------------------------------- ๐๐ผ๐ถ๐ป ๐บ๐ฒ ๐ผ๐ป ๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ:๐ฅ ------------------------------------------------------------------------- *Instagram : https://www.instagram.com/itjunction4all/ *Twitter: https://twitter.com/sunilkr5672 ------------------------------------------------------------------------- Table and Insert SQL 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); Insert into spending values(1,'2019-07-01','Desktop',100); Insert into spending values(2,'2019-07-01','Mobile',100); Insert into spending values(2,'2019-07-02','Mobile',100); Insert into spending values(3,'2019-07-01','Desktop',100); Insert into spending values(3,'2019-07-02','Desktop',100); #SQL #LEETCODE #SQLInterviewQuestionsandanswers #sqlInterviewQuestions
Download
0 formatsNo download links available.