Accenture Interview Question

write a mysql query