Question: Background Consider a hypothetical position where you work for a social network company for academics. This social network includes full professors, assistant professors, postdoctoral students,

Background Consider a hypothetical position where you work for a social network company for academics. This social network includes full professors, assistant professors, postdoctoral students, graduate students and others as members. To increase engagement and interaction among the members of this academic community, your product manager wants to roll out a feature that ranks members in the network according to the number of times other people have viewed their social profiles. The product manager sketches out a general vision for the product, which would appear differently for each user:

Your rank for profile views

1.Jane Doe 2.John Doe 3.You 4.Jon Doe 5.Jan Doe 6....

Working as the data teams point person on this project, you are responsible for pulling together and manipulating relevant data to advise the product manager on how data can inform the creation of this new feature. Central to these tasks are the tables in your companys database that contain user information and profile view records. Here's a diagram and explanation of the database schema:

Background Consider a hypothetical position where you work for a social network

Prompt

Using the table names and relations shown in the schema diagram above, please write SQL queries designed to address the following questions (since the data are not in a database, we're just looking for the queries you would write):

a. What is the average age of users by region? b. Can you generate a ranked list of the top 10 most viewed users based on internal profile views? c. Which region gets the most viewed users based on internal profile views?

Database schema user profile urls internal_profile_views user id profile_url e user id e viewed user id created at users firstname lastname age * region title id titles external_profile_views id title public_profile_url . unique_PageViews

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!