Scotiabank interview question

Some complex SQL queries and easy algorithm questions