I was trying to find out which version of Joomla was installed in a web site. The first place I looked was in the database where this type of information was normally stored. I couldn’t find any global settings table which would have the version number. This is because Joomla stores version information in the libraries folder in version.php which is located in different folders on Joomla 1.5 and Joomla 2.5/3.x.
Joomla 1.5
Joomla 2.5/3.x
In the version.php document will be the following variables:

public $RELEASE = '3.3';
public $DEV_LEVEL = '1';

This shows that the installed version of Joomla is 3.3.1.