Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following questions with SQL statements (with expected outputs) and assumptions made for queries as follows: Generate a list of paired users who are

Answer the following questions with SQL statements (with expected outputs) and assumptions made for queries as follows:

  1. Generate a list of paired users who are following each other mutually. For example, A is following B and B is following A (in other words, A is following B and A is also followed by B)
  2. Generate a list of First Positions with their Activity Date, User Name & Personal Best Detail.
  3. Generate a list of users who have received > 5 Kudos in average for each activity
  4. Compute monthly active social networks, i.e., for each user, list out his/her followers, who have given him/her >=5 Kudos for each months activities
  5. Conduct social comparison analysis, i.e., for each user, list out his or her weekly average activity distance and weekly average activity duration. Additionally, compute the weekly averages for his social networks (i.e., no of followers & followings)

The Database Design is shown below:

image text in transcribed

Challenge PK Challengels (OM) ChallengeName has followship (OM) User joins (1,M) PK UserID Club UserName (1,M) 10.M) -joins PK ClubID (OM) Gender ClubName (1,1) (1,M) gives Age (1,1) (1.1) gives Email (1,M) (0,1) owns (0,1) has Comment performs Kudo (0,M) PK CommentID UserID (OM) WeeklyLeaderboard PK CommentContent (0.M) ActivityID PK Activity LeaderboardID FK UserID (0,1) ActivityID FK ActivityID FK ClubID (1,1) ActivityDate LeaderboardDate on (0.1) (1,1) on ActivityStartTime FK FirstPos_UserID ActivityDuration FK SecondPos_UserID PersonalBest Activity Distance FK Thirdpos_UserID PK PersonalbestID ActivityPace FK FourthPos_UserID (0,1) (1,1) FK ActivityID Activity Name FK FifthPos_UserID PersonalBest Type Activity Type FK SixthPos_UserID PersonalBestDetail FK SeventhPos UserID ActivitySport Description FK EighthPos_UserID PrivacyControls FK NinthPos_UserID FK UserID FK TenthPos_UserID Challenge PK Challengels (OM) ChallengeName has followship (OM) User joins (1,M) PK UserID Club UserName (1,M) 10.M) -joins PK ClubID (OM) Gender ClubName (1,1) (1,M) gives Age (1,1) (1.1) gives Email (1,M) (0,1) owns (0,1) has Comment performs Kudo (0,M) PK CommentID UserID (OM) WeeklyLeaderboard PK CommentContent (0.M) ActivityID PK Activity LeaderboardID FK UserID (0,1) ActivityID FK ActivityID FK ClubID (1,1) ActivityDate LeaderboardDate on (0.1) (1,1) on ActivityStartTime FK FirstPos_UserID ActivityDuration FK SecondPos_UserID PersonalBest Activity Distance FK Thirdpos_UserID PK PersonalbestID ActivityPace FK FourthPos_UserID (0,1) (1,1) FK ActivityID Activity Name FK FifthPos_UserID PersonalBest Type Activity Type FK SixthPos_UserID PersonalBestDetail FK SeventhPos UserID ActivitySport Description FK EighthPos_UserID PrivacyControls FK NinthPos_UserID FK UserID FK TenthPos_UserID

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions