I am new to SQl and try to learn on my own.
i am learn the usage of if and else statement in SQL
Here is the data where I am trying to use, if or else statement in the below table, i wish to have the comments updated based on the age using the sql query, let say if the age is between 22 and 25, comments" under graduate"
Age: 26 to 27, comments " post graduate"
Age: 28 to 30, comments "working and single"
Age: 31 to 33, comments " middle level manager and married"
Table name: persons
personid lastname firstname age comments
1 Cardinal Tom 22
2 prabhu priya 33
3 bhandari abhijeet 24
4 Harry Bob 25
5 krishna anand 29
6 hari hara 31
7 ram hara 27
8 kulkarni manoj 35
9 joshi santosh 28