Rheal Software interview question

Mostly on logic and sql