Control Flow Functions In Sql