LeetCode-Feedback / LeetCode-Feedback

678 stars 334 forks source link

[Missing data] - 1211. Queries Quality and Percentage (2024) #25647

Open pei8518 opened 19 hours ago

pei8518 commented 19 hours ago

LeetCode Username

Jessie Wu

Problem Number, Title, and Link

https://leetcode.com/problems/queries-quality-and-percentage/description/?envType=study-plan-v2&envId=top-sql-50

Bug Category

Missing test case (Incorrect/Inefficient Code getting accepted because of missing test cases)

Bug Description

The description does not indicate that there will be null data in the original data. When I executed the first run test, the result was Accept, but after submitting, a wrong answer was displayed. The query name of this data table should not have null data.

Language Used for Code

MySQL

Code used for Submit/Run operation

# Write your MySQL query statement below

SELECT
    q.query_name,
    ROUND(AVG(q.rating/q.position), 2) as quality,
    ROUND(SUM(IF(q.rating < 3, 1, 0)) / COUNT(1) * 100, 2) as poor_query_percentage -- calculate poor_query_percentage 
FROM Queries as q
GROUP BY q.query_name
;

Expected behavior

Some codes got accepted in run test, but some got wrong in submit.

This is run test result below:

Output query_name quality poor_query_percentage
Dog 2.5 33.33
Cat 0.66 33.33

Screenshots

image

Additional context

No response

exalate-issue-sync[bot] commented 19 hours ago

LeetCode Support commented: Hello,

Your reported issue has been relayed to our team for thorough investigation. We appreciate your patience as we work to address and resolve this matter. We will reach out to you when we have updates regarding the issue.

If you have any further questions or concerns in the meantime, please feel free to let us know.

Best regards, LeetCode Support Team