What does Magento use to determine whether the automatically run upgrade scripts have been run yet?

A.
The modification date on the modules’ etc/config.xml file
B.
The version number (or lack thereof) stored in the core_module_version table
C.
The version number (or lack thereof) stored in the core_resource table
D.
A comparison of the resources that are capable of successfully loading