0
Leetcode Problem 1113. Reported Posts
1113. Reported Posts
AI Mock Interview
Leetcode Solutions
Counting Reported Posts by Reason Using SQL and Pandas
Solution Idea
Query Steps
Code Implementation
Filter the 'Actions' table to include only rows where 'action_date' is '2019-07-04'.
Further filter the data to include only rows where 'action' is 'report'.
Group the filtered data by the 'extra' column, which contains the report reasons.
Count the distinct 'post_id's for each group to get the number of unique reports per reason.
Rename the columns to 'report_reason' and 'report_count' for clarity.
Return the result as a DataFrame (for Pandas) or as a result set (for SQL).
erDiagram Actions { int user_id int post_id date action_date enum action varchar extra }
Ask Question
Programming Language
Purpose:
General Question
Debug My Code
image/screenshot of info
(optional)
[+]
Full Screen
Loading...
Get Answer
Suggested Answer
Answer
Full Screen
Copy Answer Code
Loading...