Question: DBAS32100 Database Management Personal Project 1 Instructions: 1. 4. Answer all the questions clearly documenting the code and the results of every question. All data
DBAS32100 Database Management Personal Project 1 Instructions: 1. 4. Answer all the questions clearly documenting the code and the results of every question. All data for creating tables for answering all questions are contained in the "DBAS32100 Personal Project 1 Data.xlsx" and \"Toronto-Stock-Data.txt\" files. Question] Data sheet contains customer, giftcard, movie, review, single_rental, and subscription table data for question 1. Question2 Data sheet contains statistics and website table data for question 2 and questions 1) g and 1) h. Question3 Data sheet contains the game and purchase table data for question 3 and questions 1) f. Toronto-Stock-Data.xlsx contains data for question 4. You are required to extract the data from the provided files and create all the required tables to use in answering the given questions. You should at least use one or more window functions in all questions. Question 1 a) b) c) d) c) For cach single rental, show the rental date, the title of the movie rented, its genre, the payment_amount and the rank of the rental in terms of the price paid (the most expensive rental should have rank = 1). The ranking should be created separately for each movie genre. Allow the same rank for multiple rows and allow gaps in numbering too. For each single rental, show the id, rental_date, payment_amount and the running total of payment_amounts of all rentals from the oldest one (in terms of rental date) until the current row. For each subscription, show the following columns: id, length, platform, payment_date, payment_amount and the future cashflows calculated as the total money from all subscriptions starting from the beginning of the payment_date of the current row (i.c., include any other payments on the very same date) until the very end. For each rental date, show the rental_date, the sum of payment amounts {column name payment_amounts) from single_rentals on that day, the sum of payment_amounts on the previous day and the difference between these two values. For cach movie, show the following information: title, genre, average user rating for that movie and its rank in the respective genre based on that average rating in descending order (so that the best movies will be shown first). From the \"game table\g) From the \"statistics table, take the statistics for the website with id = 1 between May 15 and May 20, 2016. Show the day, the revenue on that day and the third highest revenue in that period. h) From the \"statistics table, take the day May 14, 2016 and for cach row, show: website_id, revenue on that day, the highest revenue from any website on that day (AS highest revenuc) and the lowest revenue from any website on that day (as lowest_revenue). Question 2 a) For all the statistics of the website with id = 1, show the day, the number of users and the number of users on the next day. b) Write a query that calculates day-to-day differences in clicks between the current day and the next day. ) What does the clicks difference infer? d) Take the statistics for the website with id = 1 between | and 14 May 2016 and show the day, the number of users and the number of users 7 days later. Questions 3 a) Show row group distribution into "best\" games, "average\" games, and "worst" games with the larger groups coming first. b) Show the name of the game which gets rank number 2 with respect to editor rating ) Show the name, platform and update date of the second most recently updated game Questions 4 a) Using the Toronto stock data, show date, hour, highest, close and volume and find the average, minimum and maximum trading for each day it traded. Use the window clauses where applicable and ensure that all decimal values are formatted to 1 decimal place. b) Show the day with the highest and lowest trading volumes. ) Find the three-day historical average of the Toronto stock for each day it traded
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
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 Finance Questions!