Syntax
MySQL statements: keyword, names, ; at the end. Keywords are not case-sensitive (select vs SELECT). String values are. Names: letters, numbers, underscore. Use backticks `order` if you must use a reserved word.
Comments — -- to end of line, or /* block */. Strings in single quotes. Double quotes depend on sql_mode ANSI_QUOTES.
Trap — semicolon missing in the CLI so the next line ‘is part of the query’. Trap: “smart quotes” from Word.
On the example next to this theory: Syntax: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
SELECT … ; -- comment. Quotes for strings, backticks for names.