Amazon interview question

select statements, case statements joins etc