Fidelity Investments Interview Question

Code isSquare(). Asked some SQL questions