Strict format for SQL queries?

It looks like SQL query for SQL query tag has to have very specific format:

  1. OK:
    SELECT “value_int” FROM “w_0_5” WHERE object_key=‘0_5_lamp’

  2. OK:
    SELECT value_int FROM w_0_5 WHERE object_key=‘0_5_lamp’

  3. WRONG:
    SELECT value_int FROM w_0_5 WHERE object_key=“0_5_lamp”

  4. WRONG:
    SELECT ‘value_int’ FROM w_0_5 WHERE object_key=‘0_5_lamp’

  5. WRONG:
    SELECT value_int FROM ‘w_0_5’ WHERE object_key=‘0_5_lamp’

Which style is recommended?

It varies with database type. The SQL standard says double quotes are used with identifiers (eg. table and column names) while single quotes are used with string literals.
Unquoted identifiers are upper-cased by some backends, lower-cased by a few, and treated as case-insensitive by others. Form #1 is the canonical SQL standard format, where the table and column names really are lower case. I try to use form #1 so my customers can switch backends if they need to.
String literals must use single quotes. Some string literals will be converted to other types as needed, like dates or times, but in a backend-specific manner.

Bottom line: read the SQL syntax rules for your SQL backend.

Let me add: my preferred backend is PostgreSQL, which tries very hard to follow SQL standard syntax. Which means you can follow this guide and be in pretty good shape for other backends. (Modulo unquoted identifiers.)