Logio Interview Question

SQL questions and How to code Factorial