my solution inspired by the first post https://discuss.leetcode.com/topic/92683/a-silly-solution-with-subqueries-only-no-parameters, and the first method of median employee salary https://leetcode.com/problems/median-employee-salary/#/description

```
select
avg(n3.number) median
from
(select
number,
frequency,
(select ifnull(sum(n2.frequency), 0) from numbers n2 where n2.number<n1.number ) lower,
(select ifnull(sum(n2.frequency), 0) from numbers n2 where n2.number>n1.number ) higher
from numbers n1
group by number) n3
where n3.frequency >= abs(n3.lower - n3.higher)
```