Updated SQL with comments