registration codes student database logic