学会了avg(-条件-)函数的使用,求占比多少很好用,关键在于分组要分好。
# Write your MySQL query statement below
select query_name,round(sum(rating/position)/count(query_name),2) as quality,round(avg(rating<3)*100,2) as poor_query_percentage
from Queries
group by query_name;
学会了avg(-条件-)函数的使用,求占比多少很好用,关键在于分组要分好。
# Write your MySQL query statement below
select query_name,round(sum(rating/position)/count(query_name),2) as quality,round(avg(rating<3)*100,2) as poor_query_percentage
from Queries
group by query_name;