What is the SQL query to delete all users with post count 0 ?
You don't really need SQL query, there's a core feature to delete users that fall within a set criteria periodically.
ACP >> Configuration >> User Pruning
If it's not there, then evidently you don't even run 1.6