HexaOne Solutions interview question

Simple basic sql