Finoit Interview Question

Some puzzles from internet and SQL queries.