Rolls-Royce interview question

Had a short SQL and python test