Interview Query

Search Ranking

1
Have you seen this question before?

`search_results` 

column type
query varchar
result_id integer
position integer
rating integer

 

You're given a table that represents search results from searches on Facebook. The `query` column is the search term, `position` column represents each position the search result came in, and the rating column represents the human rating of the result from 1 to 5 where 5 is high relevance and 1 is low relevance.

Write a query to get the percentage of search queries where all of the ratings for the query results are less than a rating of 3. Please round your answer to two decimal points.

Output:

column type
percentage_less_than_3 float

 

Next question: MLE vs MAP
MySQL 8.0.17
Loading editor