Motortrak interview question

They asked to quickly implement a piece of code, then write a few SQL queries, and finally describe a flow using pseudo-code