Athena INSERT INTO SELECT for Data Subset
Short answer
A Use INSERT INTO cities_usa (city,state) SELECT city, state FROM cities_world WHERE country=’usa’;
Question
Key Takeaways
The core trap is confusing standard SQL INSERT syntax with non-existent commands like MOVE or UPDATE, and ensuring column lists match when inserting into specific columns.
This question tests the correct SQL syntax for copying a subset of data from an existing Amazon Athena table to a new or existing target table using the INSERT INTO ... SELECT statement.
Common mistake: Learners often select Option C because it looks simpler, but they fail to realize that explicitly listing columns in the INSERT clause (Option A) is safer and more precise, especially if the target table has more columns than the source selection.
Expert Analysis
Why the Answer Is Correct
Option A uses the standard SQL INSERT INTO <table> (<columns>) SELECT <columns> FROM <source> WHERE <condition> syntax. This correctly specifies the target table (cities_usa), the columns to populate (city, state), and filters the source data (cities_world) to include only rows where country='usa'. This is the robust way to insert a subset of data.
Why the Other Options Are Wrong
Option B (MOVE) is not a valid SQL command in Athena or standard SQL for this purpose. Option C is syntactically valid but less precise; if cities_usa has additional columns beyond city and state, omitting the column list might cause errors or unexpected behavior depending on schema definitions. Option D (UPDATE) modifies existing rows rather than inserting new ones, which contradicts the requirement to 'create' a table with the subset (or populate it).
Community Comment Notes
The community overwhelmingly voted for A. One user noted that while the prompt says 'create a new table', none of the options actually contain a CREATE TABLE statement, implying the table already exists or the question focuses purely on the insertion logic. Another comment highlighted that specifying the column list in Option A is best practice to avoid failures if the target table schema differs slightly from the source selection.
Exam Strategy
Always look for explicit column lists in INSERT INTO statements when the target schema might have more columns than the selected source data. It prevents ambiguity and errors.
Frequently Asked Questions
Why is CREATE TABLE AS SELECT not an option?
Is Option C also correct?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
Eleftheriia 👍 4 Answered AINSERT INTO cities_usa (city,state) SELECT city,state FROM cities_world WHERE country='usa'
-
truongnguyen86 👍 1 Answered Ashould be A or C but C will failed if cities_usa contains more than 2 columns so specify the list of column want to insert is the good one.
-
MerryLew 👍 1 Answered AThe INSERT INTO SELECT statement copies data from one table and inserts it into another table.
-
saqib839 👍 1 Answered Abut he said create table so neither of them is true.
-
Parandhaman_Margan 👍 1Answer:D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DEA-C01 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DEA-C01 Practice Test →