Added code to Random sql