Seriously, you do not need to manually query SQL statements just to get how many times the node has been accessed in Drupal. First, make sure that the Statistics module is enabled. Then, all you need to do is write this piece of code:
$node_stats = array();
$node_stats = statistics_get($node->nid);
print $node_stats['totalcount'];
?>