Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Background: The site FoxNews.com wants to perform some in-depth analysis on its user activities in 2020. FoxNews.com has various pages for users to view as

Background: The site FoxNews.com wants to perform some in-depth analysis on its user activities in 2020. FoxNews.com has various pages for users to view as well as videos on the pages that can be played. These Page Views and Video Views are recorded as hits in a SQL database, particularly in the table hit_data below. In addition to the hit_data table, there are various reference tables that are referenced for analysis. One interesting one is the subscribers table, which has user level information on subscribers only.

Functions that can be used:

For date manipulation, youre given the functions DAY(datetime), MONTH(datetime), and YEAR(datetime). These functions will output the part of the date timestamp inputted. Assume that theyll give you what you desire (either a date value (MONTH(2020-12-13) = 2020-12-01) or an integer (MONTH(2020-12-13) = 12)) (does not matter which you assume). You can also use any date parsing function available in SQL.

The tables are defined as:

Table Name: hit_data

Field Name

Data Type

Definition

date_timestamp

datetime

timestamp of hit

user_id

varchar

Unique ID for a given user, whether they are a subscriber or not. All hits have a user_id associated with them

hit_type

varchar

The type of hit, Page View or Video Start

hit_id

varchar

A unique ID for the hit

page_id

varchar

Unique ID for the Page. Is always present since even video hits are played on a page

video_id

varchar

Unique ID for the Video. Is null when the hit is a Video Start

Table Name: pages

Field Name

Data Type

Definition

page_id

varchar

Unique ID for the Page.

page_name

varchar

Name of the Page

page_type

varchar

Type of Page, ex: Homepage, Article, Sign In, etc.

Table Name: videos

Field Name

Data Type

Definition

video_id

varchar

Unique ID for the Video

video_name

varchar

Name of the Video

video_type

varchar

Type of Video

Table Name: subscribers

Field Name

Data Type

Definition

user_id

varchar

Unique User ID for the User and is only available if the user is a subscriber

user_name_first

varchar

First Name User provided on Sign Up

user_name_last

varchar

Last Name User provided on Sign Up

state_residence

varchar

State of User provided on Sign Up

Examples of data in tables:

Table Name: hit_data

date_timestamp

user_id

hit_type

hit_id

page_id

video_id

12/1/20 13:32

3342027

Page View

0cc175b

c4ca4238a0b923820dcc509a6f75849b

(null)

12/1/20 13:34

3342027

Video Start

92eb5ff

c4ca4238a0b923820dcc509a6f75849b

912ec803b2ce49e4a541068d495ab570

pages

page_id

page_name

page_type

c4ca4238a0b923820dcc509a6f75849b

Fox News Homepage

Homepage

d3eb9a9233e52948740d7eb8c3062d14

Article Name Here

Article

videos

video_id

video_name

video_type

912ec803b2ce49e4a541068d495ab570

Fox News Go

Livestream

subscribers

user_id

user_name_first

user_name_last

state_residence

3342027

John

Smith

NJ

  1. For the date range 11/15/20 11/20/2020, inclusive, how many total page views were there?
  2. For the date range 11/15/2020 11/20/2020, inclusive, how many total page views, video starts, and unique users were there per each day?

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

Write down the circumstances in which you led.

Answered: 1 week ago