filmov
tv
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 :
*Twitter:
-------------------------------------------------------------------------
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
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 :
*Twitter:
-------------------------------------------------------------------------
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
Комментарии