CVS interview question

Back Python query, median level sql query