Revature Interview Question

How would you write an SQL query for x?