Check out example codes for "find wordpress version in database". It will help you in understanding the concepts better.

Code Example 1

/* Make sure to consult the codex, as the db_version looks different from the wp version. */
/* https://codex.wordpress.org/WordPress_Versions */
SELECT * FROM `wp_options` where option_name = 'db_version'

Learn ReactJs, React Native from akashmittal.com