Updated database column names and made the corrections to the code.