Challenge

Project 1

--Answer 1
create database emommer;

--Answer 2
(right click on ecommerce schema -> Table Data import Wizard -> Give path of the file -> Next -> choose
options : Create a new table , select delete if exist -> next -> next)

--Answer 3
USE ecommerce;
DESC users_data;

--Answer 4
USE ecommerce;
select * from users_Data limit 100;

--Answer 5
USE ecommerce;
select count(distinct(country)),count(distinct(language)) from users_data;

--Answer 6
USE ecommerce;
SELECT SUM(socialNbFollowers),gender FROM users_data GROUP BY gender;

--Answer 7a
USE ecommerce;
select count(hasProfilePicture) Total_Profile_Picture from users_Data where hasProfilePicture='True';
--Answer 7b
USE ecommerce;
select count(hasAnyApp) Total_Application FROM users_data WHERE hasAnyApp ="True";
--Answer 7c
USE ecommerce;
SELECT COUNT(hasAndroidApp) total_use_of_android_app FROM users_data WHERE hasAndroidApp ="True";
--Answer 7d
USE ecommerce;
SELECT COUNT(hasIosApp) total_Use_of_IOS_app FROM users_data WHERE hasIosApp ="True";

--Answer 8
USE ecommerce;
SELECT country,SUM(productsBought) FROM users_data GROUP BY country ORDER BY SUM(productsBought) DESC;

--Answer 9
USE ecommerce;
SELECT country,AVG(productsSold) FROM users_data GROUP BY country ORDER BY AVG(productsSold) ASC;

--Answer 10
USE ecommerce;

--Answer 11
USE ecommerce;
SELECT language, COUNT(*) number_of_users FROM users_data GROUP BY language;

--Answer 12
USE ecommerce;
SELECT SUM(productsWished) Sum_of_Products_wished,SUM(socialProductsLiked) Sum_of_products_liked FROM users_data WHERE gender='F';

--Answer 13
USE ecommerce;
SELECT SUM(productsSold),SUM(productsBought) FROM users_data WHERE gender='M';

--Answer 14
USE ecommerce;
select country ,SUM(productsBought) Sum_of_product_bought FROM users_data GROUP BY country ORDER BY SUM(productsBought) DESC;

--Answer 15
USE ecommerce;
SELECT productsSold,country FROM users_data WHERE productsSold=0 LIMIT 10;


--Answer 16
USE ecommerce;
SELECT * FROM users_data ORDER BY daysSinceLastLogin LIMIT 110;

--Answer 17
USE ecommerce;
SELECT gender,COUNT(daysSinceLastLogin) number_of_femal_user_not_logged FROM users_data WHERE gender='F' AND daysSinceLastLogin >100;


--Answer 18
USE ecommerce;
select country,count(*) number_of_users from users_data where gender='F' group by country ;


--Answer 19
USE ecommerce;
select country,count(*) number_of_users from users_data where gender='M' group by country ;

--Answer 20
USE ecommerce;
SELECT AVG(productsSold) Average_product_sold,AVG(productsBought) Average_product_bought,country FROM users_data WHERE gender='M' GROUP BY country;

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.