Write correct MySQL queries with proper character sets, indexing, transactions, and production patterns.