Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Get total downloads, including those from , total, free and paid users. Check image for more. Need the solutions in mysql only. 2. Question 2:

Get total downloads, including those from , total, free and paid users. Check image for more. Need the solutions in mysql only. image text in transcribedimage text in transcribed

2. Question 2: Total Downloads by App We want to understand our downloads volume by app, and also see a breakdown of downloads between free and paid customers. Task: Write a query to output total downloads aggregated by app. Include the overall total downloads, downloads for just free customers, and downloads for just paid customers as three separate columns. Sort the result in descending order by overall total downloads. You are provided 3 tables: users, customers, and downloads. See below for schema and sample data tables. Schema users Name Type Description user_id INTEGER Unique ID of each user customer_id INTEGER Customer ID customers Name Type Description customer_id INTEGER Customer ID customer_type STRING Can either be "free" or "paid" downloads Name Type Description user_id INTEGER User ID date DATE Date on which download occurred app STRING App through which download occurred (could be "mobile","web" or "desktop") num_downloads INTEGER Number of downloads Sample Data Tables users user_id customer_id 1 1001 1009 N 3 3 1009 customers customer_id customer_type 1001 paid 1009 free downloads user_id date app num_downloads 2 2020-06-01 web 5 3 2020-06-02 web 10 3 3 2020-06-03 mobile 1 Sample output format (note the values shown are not the right answer): date total_downloads_overall total_downloads_free total_downloads_paid web 1234 1000 234 mobile 551 525 26 desktop 42 30 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

What are the reasons for the occurrence of specification errors?

Answered: 1 week ago