π₯ LeetCode SQL: Queries Quality and Percentage | AVG, COUNT, ROUND Explained!
Notes
π In this video, we solve the "Queries Quality and Percentage" problem from LeetCode using AVG, SUM, COUNT, and ROUND in SQL. This is a great problem for practicing aggregation, conditional counting, and percentage calculations in SQL.
π Solution Approach:
β
Calculate query quality using AVG(rating / position)
β
Find the percentage of poor queries using SUM(rating lt 3) / COUNT(*) * 100
β
Use ROUND to format results to 2 decimal places
β
Group results by query_name to categorize the data
π LeetCode Problem Link: https://leetcode.com/problems/queries-quality-and-percentage/
π’ If you found this helpful, donβt forget to LIKE π, SUBSCRIBE π, and COMMENT π¬! Letβs master SQL together! π
#SQL #LeetCode #Database #SQLQueries #CodingInterview
Discussion
Sign in to ask a question or share what you learned.