Disallow categories from this MySQL query

You could use the get_tax_sql() function introduced in WP 3.1:

$tax_query = array(
  array(
    'taxonomy' => 'category',
    'terms' => array( 4, 6, 7, 9 ),
    'operator' => 'NOT IN'
  )
);

$clauses = get_tax_sql( $tax_query, $wpdb->posts, 'ID' );

...
"SELECT ID, post_date, post_date_gmt, comment_status, comment_count
FROM $wpdb->posts {$clauses['join']}
WHERE post_status="publish"
AND post_type="post"
{$clauses['where']}
"
...

(not tested)