diff --git a/core/modules/aggregator/src/FeedStorage.php b/core/modules/aggregator/src/FeedStorage.php
index fc5edde..e6facc5 100644
--- a/core/modules/aggregator/src/FeedStorage.php
+++ b/core/modules/aggregator/src/FeedStorage.php
@@ -16,7 +16,7 @@ class FeedStorage extends SqlContentEntityStorage implements FeedStorageInterfac
    * {@inheritdoc}
    */
   public function getFeedIdsToRefresh() {
-    return $this->database->query('SELECT fid FROM {' . $this->getBaseTable() . '} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', [
+    return $this->database->query('SELECT [fid] FROM {' . $this->getBaseTable() . '} WHERE [queued] = 0 AND [checked] + [refresh] < :time AND [refresh] <> :never', [
       ':time' => REQUEST_TIME,
       ':never' => static::CLEAR_NEVER,
     ])->fetchCol();
diff --git a/core/modules/ban/src/BanIpManager.php b/core/modules/ban/src/BanIpManager.php
index 2f32923..05fbbe8 100644
--- a/core/modules/ban/src/BanIpManager.php
+++ b/core/modules/ban/src/BanIpManager.php
@@ -30,7 +30,7 @@ public function __construct(Connection $connection) {
    * {@inheritdoc}
    */
   public function isBanned($ip) {
-    return (bool) $this->connection->query("SELECT * FROM {ban_ip} WHERE ip = :ip", [':ip' => $ip])->fetchField();
+    return (bool) $this->connection->query("SELECT * FROM {ban_ip} WHERE [ip] = :ip", [':ip' => $ip])->fetchField();
   }
 
   /**
@@ -63,7 +63,7 @@ public function unbanIp($id) {
    * {@inheritdoc}
    */
   public function findById($ban_id) {
-    return $this->connection->query("SELECT ip FROM {ban_ip} WHERE iid = :iid", [':iid' => $ban_id])->fetchField();
+    return $this->connection->query("SELECT [ip] FROM {ban_ip} WHERE [iid] = :iid", [':iid' => $ban_id])->fetchField();
   }
 
 }
diff --git a/core/modules/book/src/BookOutlineStorage.php b/core/modules/book/src/BookOutlineStorage.php
index 2224bb6..dede744 100644
--- a/core/modules/book/src/BookOutlineStorage.php
+++ b/core/modules/book/src/BookOutlineStorage.php
@@ -27,7 +27,7 @@ public function __construct(Connection $connection) {
    * {@inheritdoc}
    */
   public function getBooks() {
-    return $this->connection->query("SELECT DISTINCT(bid) FROM {book}")->fetchCol();
+    return $this->connection->query("SELECT DISTINCT([bid]) FROM {book}")->fetchCol();
   }
 
   /**
@@ -35,7 +35,7 @@ public function getBooks() {
    */
   public function hasBooks() {
     return (bool) $this->connection
-      ->query('SELECT count(bid) FROM {book}')
+      ->query('SELECT count([bid]) FROM {book}')
       ->fetchField();
   }
 
@@ -89,7 +89,7 @@ public function delete($nid) {
    */
   public function loadBookChildren($pid) {
     return $this->connection
-      ->query("SELECT * FROM {book} WHERE pid = :pid", [':pid' => $pid])
+      ->query("SELECT * FROM {book} WHERE [pid] = :pid", [':pid' => $pid])
       ->fetchAllAssoc('nid', \PDO::FETCH_ASSOC);
   }
 
diff --git a/core/modules/comment/src/CommentStatistics.php b/core/modules/comment/src/CommentStatistics.php
index b82b355..24f986c 100644
--- a/core/modules/comment/src/CommentStatistics.php
+++ b/core/modules/comment/src/CommentStatistics.php
@@ -154,7 +154,7 @@ public function create(FieldableEntityInterface $entity, $fields) {
    * {@inheritdoc}
    */
   public function getMaximumCount($entity_type) {
-    return $this->database->query('SELECT MAX(comment_count) FROM {comment_entity_statistics} WHERE entity_type = :entity_type', [':entity_type' => $entity_type])->fetchField();
+    return $this->database->query('SELECT MAX([comment_count]) FROM {comment_entity_statistics} WHERE [entity_type] = :entity_type', [':entity_type' => $entity_type])->fetchField();
   }
 
   /**
diff --git a/core/modules/comment/src/CommentStorage.php b/core/modules/comment/src/CommentStorage.php
index 2334e59..28e634e 100644
--- a/core/modules/comment/src/CommentStorage.php
+++ b/core/modules/comment/src/CommentStorage.php
@@ -185,12 +185,12 @@ public function getNewCommentPageNumber($total_comments, $new_comments, Fieldabl
       $first_thread = substr($first_thread, 0, -1);
 
       // Find the number of the first comment of the first unread thread.
-      $count = $this->database->query('SELECT COUNT(*) FROM {' . $data_table . '} WHERE entity_id = :entity_id
-                        AND entity_type = :entity_type
-                        AND field_name = :field_name
-                        AND status = :status
-                        AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread
-                        AND default_langcode = 1', [
+      $count = $this->database->query('SELECT COUNT(*) FROM {' . $data_table . '} WHERE [entity_id] = :entity_id
+                        AND [entity_type] = :entity_type
+                        AND [field_name] = :field_name
+                        AND [status] = :status
+                        AND SUBSTRING([thread], 1, (LENGTH([thread]) - 1)) < :thread
+                        AND [default_langcode] = 1', [
         ':status' => CommentInterface::PUBLISHED,
         ':entity_id' => $entity->id(),
         ':field_name' => $field_name,
diff --git a/core/modules/comment/src/Plugin/views/argument/UserUid.php b/core/modules/comment/src/Plugin/views/argument/UserUid.php
index 83ed909..e24bf77 100644
--- a/core/modules/comment/src/Plugin/views/argument/UserUid.php
+++ b/core/modules/comment/src/Plugin/views/argument/UserUid.php
@@ -54,7 +54,7 @@ public function title() {
       $title = \Drupal::config('user.settings')->get('anonymous');
     }
     else {
-      $title = $this->database->query('SELECT name FROM {users_field_data} WHERE uid = :uid AND default_langcode = 1', [':uid' => $this->argument])->fetchField();
+      $title = $this->database->query('SELECT [name] FROM {users_field_data} WHERE [uid] = :uid AND [default_langcode] = 1', [':uid' => $this->argument])->fetchField();
     }
     if (empty($title)) {
       return $this->t('No user');
diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
index 2555b7b..aad75f1 100644
--- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
@@ -155,9 +155,9 @@ public function preRender(&$values) {
     }
 
     if ($nids) {
-      $result = $this->database->query("SELECT n.nid, COUNT(c.cid) as num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1
-        LEFT JOIN {history} h ON h.nid = n.nid AND h.uid = :h_uid WHERE n.nid IN ( :nids[] )
-        AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp1), :timestamp2) AND c.status = :status GROUP BY n.nid", [
+      $result = $this->database->query("SELECT [n].[nid], COUNT([c].[cid]) as num_comments FROM {node} n INNER JOIN {comment_field_data} c ON [n].[nid] = [c].[entity_id] AND [c].[entity_type] = 'node' AND [c].[default_langcode] = 1
+        LEFT JOIN {history} h ON [h].[nid] = [n].[nid] AND [h].[uid] = :h_uid WHERE [n].[nid] IN ( :nids[] )
+        AND [c].[changed] > GREATEST(COALESCE(h.timestamp, :timestamp1), :timestamp2) AND [c].[status] = :status GROUP BY [n].[nid]", [
         ':status' => CommentInterface::PUBLISHED,
         ':h_uid' => $user->id(),
         ':nids[]' => $nids,
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index 8e6a49a..1bf50e6 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -90,7 +90,7 @@ function dblog_cron() {
  *   List of uniquely defined database log message types.
  */
 function _dblog_get_message_types() {
-  return \Drupal::database()->query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type')
+  return \Drupal::database()->query('SELECT DISTINCT([type]) FROM {watchdog} ORDER BY [type]')
     ->fetchAllKeyed(0, 0);
 }
 
diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
index 64dbf36..c278070 100644
--- a/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -248,7 +248,7 @@ public function overview() {
    *   If no event found for the given ID.
    */
   public function eventDetails($event_id) {
-    $dblog = $this->database->query('SELECT w.*, u.uid FROM {watchdog} w LEFT JOIN {users} u ON u.uid = w.uid WHERE w.wid = :id', [':id' => $event_id])->fetchObject();
+    $dblog = $this->database->query('SELECT w.*, [u].[uid] FROM {watchdog} w LEFT JOIN {users} u ON [u].[uid] = [w].[uid] WHERE [w].[wid] = :id', [':id' => $event_id])->fetchObject();
 
     if (empty($dblog)) {
       throw new NotFoundHttpException();
diff --git a/core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php b/core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php
index 706e248..d62f39d 100644
--- a/core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php
+++ b/core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php
@@ -39,7 +39,7 @@ class DBLogResource extends ResourceBase {
    */
   public function get($id = NULL) {
     if ($id) {
-      $record = Database::getConnection()->query("SELECT * FROM {watchdog} WHERE wid = :wid", [':wid' => $id])
+      $record = Database::getConnection()->query("SELECT * FROM {watchdog} WHERE [wid] = :wid", [':wid' => $id])
         ->fetchAssoc();
       if (!empty($record)) {
         return new ResourceResponse($record);
diff --git a/core/modules/forum/src/ForumIndexStorage.php b/core/modules/forum/src/ForumIndexStorage.php
index 244c223..9586d60 100644
--- a/core/modules/forum/src/ForumIndexStorage.php
+++ b/core/modules/forum/src/ForumIndexStorage.php
@@ -32,7 +32,7 @@ public function __construct(Connection $database) {
    * {@inheritdoc}
    */
   public function getOriginalTermId(NodeInterface $node) {
-    return $this->database->queryRange("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, [':nid' => $node->id()])->fetchField();
+    return $this->database->queryRange("SELECT [f].[tid] FROM {forum} f INNER JOIN {node} n ON [f].[vid] = [n].[vid] WHERE [n].[nid] = :nid ORDER BY [f].[vid] DESC", 0, 1, [':nid' => $node->id()])->fetchField();
   }
 
   /**
@@ -92,14 +92,14 @@ public function update(NodeInterface $node) {
    */
   public function updateIndex(NodeInterface $node) {
     $nid = $node->id();
-    $count = $this->database->query("SELECT COUNT(cid) FROM {comment_field_data} c INNER JOIN {forum_index} i ON c.entity_id = i.nid WHERE c.entity_id = :nid AND c.field_name = 'comment_forum' AND c.entity_type = 'node' AND c.status = :status AND c.default_langcode = 1", [
+    $count = $this->database->query("SELECT COUNT([cid]) FROM {comment_field_data} c INNER JOIN {forum_index} i ON [c].[entity_id] = [i].[nid] WHERE [c].[entity_id] = :nid AND [c].[field_name] = 'comment_forum' AND [c].[entity_type] = 'node' AND [c].[status] = :status AND [c].[default_langcode] = 1", [
       ':nid' => $nid,
       ':status' => CommentInterface::PUBLISHED,
     ])->fetchField();
 
     if ($count > 0) {
       // Comments exist.
-      $last_reply = $this->database->queryRange("SELECT cid, name, created, uid FROM {comment_field_data} WHERE entity_id = :nid AND field_name = 'comment_forum' AND entity_type = 'node' AND status = :status AND default_langcode = 1 ORDER BY cid DESC", 0, 1, [
+      $last_reply = $this->database->queryRange("SELECT [cid], [name], [created], [uid] FROM {comment_field_data} WHERE [entity_id] = :nid AND [field_name] = 'comment_forum' AND [entity_type] = 'node' AND [status] = :status AND [default_langcode] = 1 ORDER BY [cid] DESC", 0, 1, [
         ':nid' => $nid,
         ':status' => CommentInterface::PUBLISHED,
       ])->fetchObject();
diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index a6d0f27..fd44211 100644
--- a/core/modules/history/history.module
+++ b/core/modules/history/history.module
@@ -81,7 +81,7 @@ function history_read_multiple($nids) {
     return $return;
   }
 
-  $result = \Drupal::database()->query('SELECT nid, timestamp FROM {history} WHERE uid = :uid AND nid IN ( :nids[] )', [
+  $result = \Drupal::database()->query('SELECT [nid], timestamp FROM {history} WHERE [uid] = :uid AND [nid] IN ( :nids[] )', [
     ':uid' => \Drupal::currentUser()->id(),
     ':nids[]' => array_keys($nodes_to_read),
   ]);
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 663abd1..cb0d163 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -799,7 +799,7 @@ function locale_translation_get_file_history() {
 
   if (empty($history)) {
     // Get file history from the database.
-    $result = \Drupal::database()->query('SELECT project, langcode, filename, version, uri, timestamp, last_checked FROM {locale_file}');
+    $result = \Drupal::database()->query('SELECT [project], [langcode], [filename], [version], [uri], timestamp, [last_checked] FROM {locale_file}');
     foreach ($result as $file) {
       $file->type = $file->timestamp ? LOCALE_TRANSLATION_CURRENT : '';
       $history[$file->project][$file->langcode] = $file;
diff --git a/core/modules/migrate/migrate.api.php b/core/modules/migrate/migrate.api.php
index c705d17..db2c20e 100644
--- a/core/modules/migrate/migrate.api.php
+++ b/core/modules/migrate/migrate.api.php
@@ -113,7 +113,7 @@
  */
 function hook_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
   if ($migration->id() == 'd6_filter_formats') {
-    $value = $source->getDatabase()->query('SELECT value FROM {variable} WHERE name = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField();
+    $value = $source->getDatabase()->query('SELECT [value] FROM {variable} WHERE [name] = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField();
     if ($value) {
       $row->setSourceProperty('settings:mymodule:foo', unserialize($value));
     }
@@ -136,7 +136,7 @@ function hook_migrate_prepare_row(Row $row, MigrateSourceInterface $source, Migr
  * @ingroup migration
  */
 function hook_migrate_MIGRATION_ID_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {
-  $value = $source->getDatabase()->query('SELECT value FROM {variable} WHERE name = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField();
+  $value = $source->getDatabase()->query('SELECT [value] FROM {variable} WHERE [name] = :name', [':name' => 'mymodule_filter_foo_' . $row->getSourceProperty('format')])->fetchField();
   if ($value) {
     $row->setSourceProperty('settings:mymodule:foo', unserialize($value));
   }
diff --git a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php
index 85a546d..568b4f7 100644
--- a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php
+++ b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php
@@ -209,7 +209,7 @@ public static function getLegacyDrupalVersion(Connection $connection) {
     if ($connection->schema()->tableExists('system')) {
       try {
         $version_string = $connection
-          ->query('SELECT schema_version FROM {system} WHERE name = :module', [':module' => 'system'])
+          ->query('SELECT [schema_version] FROM {system} WHERE [name] = :module', [':module' => 'system'])
           ->fetchField();
         if ($version_string && $version_string[0] == '1') {
           if ((int) $version_string >= 1000) {
@@ -229,7 +229,7 @@ public static function getLegacyDrupalVersion(Connection $connection) {
     elseif ($connection->schema()->tableExists('key_value')) {
       try {
         $result = $connection
-          ->query("SELECT value FROM {key_value} WHERE collection = :system_schema  and name = :module", [
+          ->query("SELECT [value] FROM {key_value} WHERE [collection] = :system_schema  and [name] = :module", [
             ':system_schema' => 'system.schema',
             ':module' => 'system',
           ])
diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php
index 54013ff..21976b4 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -380,7 +380,7 @@ function hook_node_access(\Drupal\node\NodeInterface $node, $op, \Drupal\Core\Se
  * @ingroup entity_crud
  */
 function hook_node_search_result(\Drupal\node\NodeInterface $node) {
-  $rating = \Drupal::database()->query('SELECT SUM(points) FROM {my_rating} WHERE nid = :nid', ['nid' => $node->id()])->fetchField();
+  $rating = \Drupal::database()->query('SELECT SUM([points]) FROM {my_rating} WHERE [nid] = :nid', ['nid' => $node->id()])->fetchField();
   return ['rating' => \Drupal::translation()->formatPlural($rating, '1 point', '@count points')];
 }
 
@@ -400,7 +400,7 @@ function hook_node_search_result(\Drupal\node\NodeInterface $node) {
  */
 function hook_node_update_index(\Drupal\node\NodeInterface $node) {
   $text = '';
-  $ratings = \Drupal::database()->query('SELECT title, description FROM {my_ratings} WHERE nid = :nid', [':nid' => $node->id()]);
+  $ratings = \Drupal::database()->query('SELECT [title], [description] FROM {my_ratings} WHERE [nid] = :nid', [':nid' => $node->id()]);
   foreach ($ratings as $rating) {
     $text .= '<h2>' . Html::escape($rating->title) . '</h2>' . Xss::filter($rating->description);
   }
diff --git a/core/modules/node/src/Form/NodeRevisionDeleteForm.php b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
index aefefde..3b63e76 100644
--- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php
+++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
@@ -142,7 +142,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       'entity.node.canonical',
       ['node' => $this->revision->id()]
     );
-    if ($this->connection->query('SELECT COUNT(DISTINCT vid) FROM {node_field_revision} WHERE nid = :nid', [':nid' => $this->revision->id()])->fetchField() > 1) {
+    if ($this->connection->query('SELECT COUNT(DISTINCT [vid]) FROM {node_field_revision} WHERE [nid] = :nid', [':nid' => $this->revision->id()])->fetchField() > 1) {
       $form_state->setRedirect(
         'entity.node.version_history',
         ['node' => $this->revision->id()]
diff --git a/core/modules/node/src/NodeStorage.php b/core/modules/node/src/NodeStorage.php
index 2895f6c..68af3f9 100644
--- a/core/modules/node/src/NodeStorage.php
+++ b/core/modules/node/src/NodeStorage.php
@@ -19,7 +19,7 @@ class NodeStorage extends SqlContentEntityStorage implements NodeStorageInterfac
    */
   public function revisionIds(NodeInterface $node) {
     return $this->database->query(
-      'SELECT vid FROM {' . $this->getRevisionTable() . '} WHERE nid=:nid ORDER BY vid',
+      'SELECT [vid] FROM {' . $this->getRevisionTable() . '} WHERE [nid]=:nid ORDER BY [vid]',
       [':nid' => $node->id()]
     )->fetchCol();
   }
@@ -29,7 +29,7 @@ public function revisionIds(NodeInterface $node) {
    */
   public function userRevisionIds(AccountInterface $account) {
     return $this->database->query(
-      'SELECT vid FROM {' . $this->getRevisionDataTable() . '} WHERE uid = :uid ORDER BY vid',
+      'SELECT [vid] FROM {' . $this->getRevisionDataTable() . '} WHERE [uid] = :uid ORDER BY [vid]',
       [':uid' => $account->id()]
     )->fetchCol();
   }
@@ -38,7 +38,7 @@ public function userRevisionIds(AccountInterface $account) {
    * {@inheritdoc}
    */
   public function countDefaultLanguageRevisions(NodeInterface $node) {
-    return $this->database->query('SELECT COUNT(*) FROM {' . $this->getRevisionDataTable() . '} WHERE nid = :nid AND default_langcode = 1', [':nid' => $node->id()])->fetchField();
+    return $this->database->query('SELECT COUNT(*) FROM {' . $this->getRevisionDataTable() . '} WHERE [nid] = :nid AND [default_langcode] = 1', [':nid' => $node->id()])->fetchField();
   }
 
   /**
diff --git a/core/modules/node/src/Plugin/Action/AssignOwnerNode.php b/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
index d9a9a43..3508f54 100644
--- a/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
+++ b/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
@@ -82,7 +82,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
     // Use dropdown for fewer than 200 users; textbox for more than that.
     if (intval($count) < 200) {
       $options = [];
-      $result = $this->connection->query("SELECT uid, name FROM {users_field_data} WHERE uid > 0 AND default_langcode = 1 ORDER BY name");
+      $result = $this->connection->query("SELECT [uid], [name] FROM {users_field_data} WHERE [uid] > 0 AND [default_langcode] = 1 ORDER BY [name]");
       foreach ($result as $data) {
         $options[$data->uid] = $data->name;
       }
diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php
index 390fa20..5d88e58 100644
--- a/core/modules/node/src/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/src/Plugin/Search/NodeSearch.php
@@ -559,7 +559,7 @@ public function markForReindex() {
    */
   public function indexStatus() {
     $total = $this->database->query('SELECT COUNT(*) FROM {node}')->fetchField();
-    $remaining = $this->database->query("SELECT COUNT(DISTINCT n.nid) FROM {node} n LEFT JOIN {search_dataset} sd ON sd.sid = n.nid AND sd.type = :type WHERE sd.sid IS NULL OR sd.reindex <> 0", [':type' => $this->getPluginId()])->fetchField();
+    $remaining = $this->database->query("SELECT COUNT(DISTINCT [n].[nid]) FROM {node} n LEFT JOIN {search_dataset} sd ON [sd].[sid] = [n].[nid] AND [sd].[type] = :type WHERE [sd].[sid] IS NULL OR [sd].[reindex] <> 0", [':type' => $this->getPluginId()])->fetchField();
 
     return ['remaining' => $remaining, 'total' => $total];
   }
diff --git a/core/modules/node/src/Plugin/views/argument/Vid.php b/core/modules/node/src/Plugin/views/argument/Vid.php
index ff1c0ac..7d4835d 100644
--- a/core/modules/node/src/Plugin/views/argument/Vid.php
+++ b/core/modules/node/src/Plugin/views/argument/Vid.php
@@ -68,7 +68,7 @@ public static function create(ContainerInterface $container, array $configuratio
   public function titleQuery() {
     $titles = [];
 
-    $results = $this->database->query('SELECT nr.vid, nr.nid, npr.title FROM {node_revision} nr WHERE nr.vid IN ( :vids[] )', [':vids[]' => $this->value])->fetchAllAssoc('vid', PDO::FETCH_ASSOC);
+    $results = $this->database->query('SELECT [nr].[vid], [nr].[nid], [npr].[title] FROM {node_revision} nr WHERE [nr].[vid] IN ( :vids[] )', [':vids[]' => $this->value])->fetchAllAssoc('vid', PDO::FETCH_ASSOC);
     $nids = [];
     foreach ($results as $result) {
       $nids[] = $result['nid'];
diff --git a/core/modules/search/src/SearchIndex.php b/core/modules/search/src/SearchIndex.php
index e5655d4..ca9697a 100644
--- a/core/modules/search/src/SearchIndex.php
+++ b/core/modules/search/src/SearchIndex.php
@@ -286,7 +286,7 @@ public function updateWordWeights(array $words) {
       $words = array_keys($words);
       foreach ($words as $word) {
         // Get total count.
-        $total = $this->replica->query("SELECT SUM(score) FROM {search_index} WHERE word = :word", [':word' => $word])
+        $total = $this->replica->query("SELECT SUM([score]) FROM {search_index} WHERE [word] = :word", [':word' => $word])
           ->fetchField();
         // Apply Zipf's law to equalize the probability distribution.
         $total = log10(1 + 1 / (max(1, $total)));
@@ -298,7 +298,7 @@ public function updateWordWeights(array $words) {
       // Find words that were deleted from search_index, but are still in
       // search_total. We use a LEFT JOIN between the two tables and keep only
       // the rows which fail to join.
-      $result = $this->replica->query("SELECT t.word AS realword, i.word FROM {search_total} t LEFT JOIN {search_index} i ON t.word = i.word WHERE i.word IS NULL");
+      $result = $this->replica->query("SELECT [t].[word] AS realword, [i].[word] FROM {search_total} t LEFT JOIN {search_index} i ON [t].[word] = [i].[word] WHERE [i].[word] IS NULL");
       $or = new Condition('OR');
       foreach ($result as $word) {
         $or->condition('word', $word->realword);
diff --git a/core/modules/shortcut/src/ShortcutSetStorage.php b/core/modules/shortcut/src/ShortcutSetStorage.php
index 3318f6c..56892a2 100644
--- a/core/modules/shortcut/src/ShortcutSetStorage.php
+++ b/core/modules/shortcut/src/ShortcutSetStorage.php
@@ -119,7 +119,7 @@ public function getAssignedToUser($account) {
    * {@inheritdoc}
    */
   public function countAssignedUsers(ShortcutSetInterface $shortcut_set) {
-    return Database::getConnection()->query('SELECT COUNT(*) FROM {shortcut_set_users} WHERE set_name = :name', [':name' => $shortcut_set->id()])->fetchField();
+    return Database::getConnection()->query('SELECT COUNT(*) FROM {shortcut_set_users} WHERE [set_name] = :name', [':name' => $shortcut_set->id()])->fetchField();
   }
 
   /**
diff --git a/core/modules/tracker/tracker.install b/core/modules/tracker/tracker.install
index 9dcf703..28afb74 100644
--- a/core/modules/tracker/tracker.install
+++ b/core/modules/tracker/tracker.install
@@ -16,7 +16,7 @@ function tracker_uninstall() {
  * Implements hook_install().
  */
 function tracker_install() {
-  $max_nid = \Drupal::database()->query('SELECT MAX(nid) FROM {node}')->fetchField();
+  $max_nid = \Drupal::database()->query('SELECT MAX([nid]) FROM {node}')->fetchField();
   if ($max_nid != 0) {
     \Drupal::state()->set('tracker.index_nid', $max_nid);
     // To avoid timing out while attempting to do a complete indexing, we
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index 457d293..d8c9645 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -212,7 +212,7 @@ function _tracker_add($nid, $uid, $changed) {
   $connection = \Drupal::database();
   // @todo This should be actually filtering on the desired language and just
   //   fall back to the default language.
-  $node = $connection->query('SELECT nid, status, uid, changed FROM {node_field_data} WHERE nid = :nid AND default_langcode = 1 ORDER BY changed DESC, status DESC', [':nid' => $nid])->fetchObject();
+  $node = $connection->query('SELECT [nid], [status], [uid], [changed] FROM {node_field_data} WHERE [nid] = :nid AND [default_langcode] = 1 ORDER BY [changed] DESC, [status] DESC', [':nid' => $nid])->fetchObject();
 
   // Adding a comment can only increase the changed timestamp, so our
   // calculation here is simple.
@@ -314,7 +314,7 @@ function _tracker_remove($nid, $uid = NULL, $changed = NULL) {
     // and the node itself.
     // We only need to do this if the removed item has a timestamp that equals
     // or exceeds the listed changed timestamp for the node.
-    $tracker_node = $connection->query('SELECT nid, changed FROM {tracker_node} WHERE nid = :nid', [':nid' => $nid])->fetchObject();
+    $tracker_node = $connection->query('SELECT [nid], [changed] FROM {tracker_node} WHERE [nid] = :nid', [':nid' => $nid])->fetchObject();
     if ($tracker_node && $changed >= $tracker_node->changed) {
       // If we're here, the item being removed is *possibly* the item that
       // established the node's changed timestamp.
diff --git a/core/modules/user/src/Authentication/Provider/Cookie.php b/core/modules/user/src/Authentication/Provider/Cookie.php
index ebcdae7..dab9b93 100644
--- a/core/modules/user/src/Authentication/Provider/Cookie.php
+++ b/core/modules/user/src/Authentication/Provider/Cookie.php
@@ -71,14 +71,14 @@ protected function getUserFromSession(SessionInterface $session) {
       // @todo Load the User entity in SessionHandler so we don't need queries.
       // @see https://www.drupal.org/node/2345611
       $values = $this->connection
-        ->query('SELECT * FROM {users_field_data} u WHERE u.uid = :uid AND u.default_langcode = 1', [':uid' => $uid])
+        ->query('SELECT * FROM {users_field_data} u WHERE [u].[uid] = :uid AND [u].[default_langcode] = 1', [':uid' => $uid])
         ->fetchAssoc();
 
       // Check if the user data was found and the user is active.
       if (!empty($values) && $values['status'] == 1) {
         // Add the user's roles.
         $rids = $this->connection
-          ->query('SELECT roles_target_id FROM {user__roles} WHERE entity_id = :uid', [':uid' => $values['uid']])
+          ->query('SELECT [roles_target_id] FROM {user__roles} WHERE [entity_id] = :uid', [':uid' => $values['uid']])
           ->fetchCol();
         $values['roles'] = array_merge([AccountInterface::AUTHENTICATED_ROLE], $rids);
 
diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php
index c1cd896..d5f4221 100644
--- a/core/modules/user/src/Plugin/views/field/Roles.php
+++ b/core/modules/user/src/Plugin/views/field/Roles.php
@@ -73,7 +73,7 @@ public function preRender(&$values) {
 
     if ($uids) {
       $roles = user_roles();
-      $result = $this->database->query('SELECT u.entity_id as uid, u.roles_target_id as rid FROM {user__roles} u WHERE u.entity_id IN ( :uids[] ) AND u.roles_target_id IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]);
+      $result = $this->database->query('SELECT [u].[entity_id] as uid, [u].[roles_target_id] as rid FROM {user__roles} u WHERE [u].[entity_id] IN ( :uids[] ) AND [u].[roles_target_id] IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]);
       foreach ($result as $role) {
         $this->items[$role->uid][$role->rid]['role'] = $roles[$role->rid]->label();
         $this->items[$role->uid][$role->rid]['rid'] = $role->rid;
diff --git a/core/modules/user/src/UserStorage.php b/core/modules/user/src/UserStorage.php
index 7ca4f24..a2adfe9 100644
--- a/core/modules/user/src/UserStorage.php
+++ b/core/modules/user/src/UserStorage.php
@@ -21,7 +21,7 @@ protected function doSaveFieldItems(ContentEntityInterface $entity, array $names
     // The anonymous user account is saved with the fixed user ID of 0.
     // Therefore we need to check for NULL explicitly.
     if ($entity->id() === NULL) {
-      $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {' . $this->getBaseTable() . '}')->fetchField());
+      $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX([uid]) FROM {' . $this->getBaseTable() . '}')->fetchField());
       $entity->enforceIsNew();
     }
     return parent::doSaveFieldItems($entity, $names);
