Revature interview question

How would you write an SQL query for x?