How can I identify if a database is D6 or D7?
In Drupal 6 the node revisions are in {node_revisions}, and in Drupal 7 the node revisions are in {node_revision}.  So, you can just check which table exists.  There are some structural differences with the tables, too.  For example there is a status column in D7, but not in D6.