Using the facebook database: Setup: Generate a temporary table SignUpsOn , that shows the number of people
Question:
Using the facebook database:
Setup: Generate atemporary table SignUpsOn, that shows the number of people that signed up on that day (using the MemberSince attribute)
Setup:Generatea temporary table InactiveOn, that shows the number of people that became inactive that day (using the LastUpdate attribute)
SingUpsAsOf: Using the SignUpsOn table, calculate the total number of users signed up for Facebook up to each date listed in the MemberSince column. (In other words, calculate the cumulative sum of users from the SignUpsOn table.) Use a SUM() function together with a window specification.
InactiveAsOf: Using the InactiveOntable, calculate the total number of users who are inactive as of a given date (again, up to each date in the MemberSince. Use a SUM() function together with a window specification.
Using the SingUpsAsOf and InactiveAsOf, calculate the total_active users for each date. We define total active users as the total signups up to that date, minus the total users that have been inactive up to that date.
Using the flight database:
Generate the passengers_per_airport temporary table, which contains the total number of passengers departing from each airport. Use the m_ticket_prices table; we are interested in the origin and the passengers attributes.
Using the passengers_per_airport table from the previous question, calculate each airport's national rankandstate rankin terms of departing passengers. The m_airports table contains the state of each airport. (Note: The number 1 airport nationally will have the most passengers nationwide, while the number 1 per state will have the most passengers within the state.)