The syntax of the query you have within a cfquery tag really depends on the type of database that you're querying. So inside the cfquery tag, you're identifying the datasource="db_name". Over in the CF Administrator, you're setting up the type of database (Access, MS SQL), defining the correct driver, and naming the db, e.g. "db_name".
e.g. If you're writing a query for Access, you would use syntax appropriate for Access. SQL
e.g. If you're writing a query for MS SQL 2008, would use syntax appropriate for MS SQL 2008. T-SQL