Amazon interview question

How do you write certain SQL codes