Fraudulent Upvotes
Start Timer
0:00:00
We are given three tables about a digital community, users
, comments
, comment_votes
, representing a forum of users and their comments on posts.
We want to figure out if bad actor users are creating multiple accounts in order to upvote their own comments.
What kind of metrics could we use to figure this out?
Write a query that could display the percentage of users on our forum that would be acting fraudulently in this manner.
Example:
Input:
users
table
Column | Type |
---|---|
id |
INTEGER |
created_at |
DATETIME |
username |
VARCHAR |
comments
table
Column | Type |
---|---|
id |
INTEGER |
created_at |
DATETIME |
post_id |
INTEGER |
user_id |
INTEGER |
comment_votes
table
Column | Type |
---|---|
id |
INTEGER |
created_at |
DATETIME |
user_id |
INTEGER |
comment_id |
INTEGER |
is_upvote |
BOOLEAN |
Output:
Column | Type |
---|---|
voter_id |
INTEGER |
voter |
VARCHAR |
commenter_id |
INTEGER |
commenter |
VARCHAR |
vote_perc |
FLOAT |
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments