Meta interview question

Two SQL and a case question