Check here, for more details : https://www.c-sharpcorner.com/article/mysql-if-function/
The IF() function returns a value if a condition is TRUE, or another value if a condition is FALSE.SELECT IF(500<1000, "YES", "NO");Output : YES