Interview Query

Acceptance Rate

Start Timer

0:00:00

Upvote
10
Downvote
Save question
Mark as completed
View comments (63)
Next question

We’re given two tables. friend_requests holds all the friend requests made and friend_accepts is all of the acceptances.

Write a query to find the overall acceptance rate of friend requests.

Note: Round results to 4 decimal places.

Example:

Input:

friend_requests table

Column Type
requester_id INTEGER
requested_id INTEGER
created_at DATETIME

friend_accepts table

Column Type
acceptor_id INTEGER
requester_id INTEGER
created_at DATETIME

Output:

Column Type
acceptance_rate FLOAT
.
.
.
.
.


Comments

Loading comments