Question: Tables: Payment Table: This table contains all the payment records on a date and member level. This is for members who make a payment on

Tables: Payment Table: This table contains all the payment records on a date and member level. This is for members who make a payment on each day. A sample data looks like this: Date memberID Amount 1/3 A $33.9 1/4 C $19.3 1/7 A $29.1

User Table: This table contains all the active records on a date and member level. This is for member who visit linkedin.com site on each day. A sample data looks like this: Date memberID 1/1 A 1/3 A 1/3 B 1/4 A 1/4 C 1/5 B

Date Table: this table contains the date information Date 1/1 1/2 1/3 1/4 1/5 1/6

Questions: Please write a query for the following cases: (1) Total Revenue & Payers: Create a table to display total revenue & number of buyers on each day Date revenue buyers SELECT pt.Date (2) Top payers: Create a table to display the top one payer on each day Date memberID

(3) A distribution of # days active within a week: Create a table to show how many members are active for 1 day, 2days, 3days,7days during 3/1-3/7.

#Days Active Count 1 2 3 4 5 6 7

(4) Active but not payers: Create a table to display people who were active but did not pay on each day Date memberID

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!