diff --git a/core/modules/history/history.module b/core/modules/history/history.module
index a6d0f27fc9..5495d539ff 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/migrate/migrate.api.php b/core/modules/migrate/migrate.api.php
index c705d1719f..571c7f1a6b 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));
     }
diff --git a/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php b/core/modules/migrate_drupal/src/MigrationConfigurationTrait.php
index 85a546debe..568b4f7820 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/search/src/SearchIndex.php b/core/modules/search/src/SearchIndex.php
index e5655d4974..aeaf9f6b27 100644
--- a/core/modules/search/src/SearchIndex.php
+++ b/core/modules/search/src/SearchIndex.php
@@ -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/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
index 3226fde67a..9e015b9d2f 100644
--- a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
@@ -100,7 +100,7 @@ public function testSearchIndexUpdateOnNodeDeletion() {
 
     // Get the node info from the search index tables.
     $connection = Database::getConnection();
-    $search_index_dataset = $connection->query("SELECT sid FROM {search_index} WHERE type = 'node_search' AND  word = :word", [':word' => 'dragons'])
+    $search_index_dataset = $connection->query("SELECT [sid] FROM {search_index} WHERE [type] = 'node_search' AND  [word] = :word", [':word' => 'dragons'])
       ->fetchField();
     $this->assertNotEqual($search_index_dataset, FALSE, t('Node info found on the search_index'));
 
@@ -108,7 +108,7 @@ public function testSearchIndexUpdateOnNodeDeletion() {
     $node->delete();
 
     // Check if the node info is gone from the search table.
-    $search_index_dataset = $connection->query("SELECT sid FROM {search_index} WHERE type = 'node_search' AND  word = :word", [':word' => 'dragons'])
+    $search_index_dataset = $connection->query("SELECT [sid] FROM {search_index} WHERE [type] = 'node_search' AND  [word] = :word", [':word' => 'dragons'])
       ->fetchField();
     $this->assertFalse($search_index_dataset, t('Node info successfully removed from search_index'));
 
diff --git a/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php b/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
index 9eb111e124..ad88ab7518 100644
--- a/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
+++ b/core/modules/system/tests/src/Functional/Database/TemporaryQueryTest.php
@@ -44,8 +44,8 @@ public function testTemporaryQuery() {
     }
 
     // Now try to run two temporary queries in the same request.
-    $table_name_test = $connection->queryTemporary('SELECT name FROM {test}', []);
-    $table_name_task = $connection->queryTemporary('SELECT pid FROM {test_task}', []);
+    $table_name_test = $connection->queryTemporary('SELECT [name] FROM {test}', []);
+    $table_name_task = $connection->queryTemporary('SELECT [pid] FROM {test_task}', []);
 
     $this->assertEqual($this->countTableRows($table_name_test), $this->countTableRows('test'), 'A temporary table was created successfully in this request.');
     $this->assertEqual($this->countTableRows($table_name_task), $this->countTableRows('test_task'), 'A second temporary table was created successfully in this request.');
diff --git a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
index d51b224430..340486fd5e 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -117,7 +117,7 @@ public function testTaxonomyIndex() {
     // Check that the term is indexed, and only once.
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
     $connection = Database::getConnection();
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
@@ -128,12 +128,12 @@ public function testTaxonomyIndex() {
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     // Check that both terms are indexed.
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed.');
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ])->fetchField();
@@ -144,12 +144,12 @@ public function testTaxonomyIndex() {
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
 
     // Check that only one term is indexed.
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
     $this->assertEqual(0, $index_count, 'Term 1 is not indexed.');
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ])->fetchField();
@@ -164,12 +164,12 @@ public function testTaxonomyIndex() {
     $node->save();
 
     // Check that the index was not changed.
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
     $this->assertEqual(0, $index_count, 'Term 1 is not indexed.');
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ])->fetchField();
@@ -180,12 +180,12 @@ public function testTaxonomyIndex() {
     $node->save();
 
     // Check that both terms are indexed.
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed.');
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ])->fetchField();
@@ -196,12 +196,12 @@ public function testTaxonomyIndex() {
     $node->save();
 
     // Check that only one term is indexed.
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_1->id(),
     ])->fetchField();
     $this->assertEqual(1, $index_count, 'Term 1 is indexed once.');
-    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', [
+    $index_count = $connection->query('SELECT COUNT(*) FROM {taxonomy_index} WHERE [nid] = :nid AND [tid] = :tid', [
       ':nid' => $node->id(),
       ':tid' => $term_2->id(),
     ])->fetchField();
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index 457d2932e5..7a44d63189 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.
