Project 1
## Answer 1
create schema ecommerce ;
## Answer 2
-- Imported .csv file in ecommerce schema.
## Answer 3
desc users_data;
## Answer 4
select * from users_data limit 100;
## Answer 5
select distinct country,language from users_data;
## Answer 6
select sum(socialnbfollowers) as Followers,gender from users_data group by gender ;
-- Female users having Maximum Followers.
## Answer 7
SELECT 'Uses Profile Picture in their Profile' Parameters,COUNT(*) USERS FROM users_data WHERE hasProfilePicture = 'TRUE' UNION
SELECT 'Uses Application for Ecommerce platform',COUNT(*) FROM users_data WHERE hasAnyApp = 'TRUE' UNION
SELECT 'Uses Android app',COUNT(*) FROM users_data WHERE hasAndroidApp = 'TRUE' UNION
SELECT 'Uses ios app',COUNT(*) FROM users_data WHERE hasIosApp = 'TRUE';
## Answer 8
select country,sum(productsBought) as Total_Number_of_buyers from users_data
where productsBought >=1 group by country order by sum(productsBought) desc;
## Answer 9
select country,sum(productsSold) as Total_Number_of_sellers from users_data
where productsSold >=1 group by country order by sum(productsSold) asc ;
## Answer 10
select country,sum(productsPassRate) from users_data group by country order by sum(productsPassRate) desc limit 10;
## Answer 11
select language,count(language) as Number_of_users_language_choices from users_data group by language;
## Answer 12
SELECT 'F' GENDER,' Product wish' Product, SUM(productsWished) Total FROM users_data WHERE gender ='F' UNION
SELECT 'F ','Product Like' ,SUM(socialProductsLiked) FROM users_data WHERE gender ='F';
## Answer 13
SELECT 'M' Gender ,'Product Sell' Product ,SUM(productsSold) Total FROM users_data WHERE gender ='M'union
SELECT 'M' ,'Product Bought',SUM(productsBought) FROM users_data WHERE gender ='M';
please find the below attachment.
## ANswer 14
select country, sum(productsbought) as Maximum_no_of_buyers from users_data group by country order by sum(productsBought) desc ;
-- France country having Maximum buyers = 25135
## Answer 15
select distinct country,productssold from users_data where productsSold = 0 limit 10;
## Answer 16
select identifierHash, dayssincelastlogin as Top_110_users_recently_used from users_data order by daysSinceLastLogin asc limit 110;
## Answer 17
select count(dayssincelastlogin) ,gender from users_data where gender = 'F' and daysSinceLastLogin > '100';
## Answer 18
SELECT country,COUNT(*) FROM users_data WHERE gender ='F' GROUP BY country ORDER BY country;
## Answer 19
SELECT country,COUNT(*) FROM users_data WHERE gender ='M' GROUP BY country ORDER BY country;
## Answer 20
select distinct country,avg(productssold) as AVG_SOLD,avg(productsbought) as AVG_BOUGHT from users_data where gender = 'M' group by country;