How to teach PhpStorm to recognise drupal {table} SQL syntax?
In PhpStorm Preferences > Tools > Database > User Parameters:


Check "Enable in string literals with SQL injection"
Add \{\w+\} to Parameter Patterns.


You may also want to modify the line with %\w+ to be allowed for language php for placeholders like %d. See screenshot and also JetBrain's PhpStorm blog post: Database Language Injection Configuration.