SQL Interview Questions and answers Part 48 | SQL LEET CODE Hard Problem

Опубликовано: 01 Март 2026
на канале: ItJunction4all
4,246
77

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 :
  / itjunction4all  

*Twitter:
  / 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