Microsoft interview question

Elevator program, some SQL queries