Question: You have a users table containing 1M+ rows of user information and a friend_requests table containing 1M+ rows of friend request information. Below are the

You have a users table containing 1M+ rows of user information and a friend_requests table containing 1M+ rows of friend request information. Below are the first 3 rows of each table.

users

user_id

username

email

friend_count

3437315

janedoe2.0

janedoe2.0@email.com

5

3437316

princessluv8996

princessluv8996@email.com

600017

3437317

sk8ter4l!f3

sk8ter4l!f3@email.com

583

friend_requests

action_id

requester_id

requestee_id

action_timestamp

action_taken

1

1037392

3437315

2015-03-15 00:01:05

Requested

2

2138102

5438443

2015-03-15 00:01:07

Accepted

3

2331234

1231232

2015-03-15 00:01:08

Rejected

Question 2: Write a SQL query that returns the three users who have sent the most friend requests. Your query should return the username and number of requests sent.

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!