Check out example codes for "myslq if". It will help you in understanding the concepts better.

Code Example 1

SELECT 
  IF(500<1000, "YES", "NO");

Learn ReactJs, React Native from akashmittal.com