AT&T interview question

Some basic SQL questions - write a query