Amazon interview question

Logical Jar problem,Basic aptitude concepts(time and work),Questions about SQL query