SQL · Google · Medium
Table: search_frequency This table has no primary key. Each row records that num_users users performed exactly searches searches in the past year. Write a SQL query that computes the median number of searches per user last year. Round the median to one decimal place and return it in a column named median. Example Input: Output: Explanation: If we expand the rows by their frequencies, we get the list [1, 1, 2, 2, 3, 3, 3, 4]. There are 8 values, so the median is the average…
Checking your access…