Which SQL statement creates a new empty Amazon Athena table new_table that has the same schema as an existing table old_table?
Choose an answer
Tap an option to check your answer.
Correct answer: CREATE TABLE new_table AS (SELECT * FROM old_table) WITH NO DATA;.
Why this is the answer
The correct statement is CREATE TABLE newtable AS (SELECT FROM oldtable) WITH NO DATA; because it leverages the CREATE TABLE AS SELECT (CTAS) syntax, which is supported by Athena, and the WITH NO DATA clause specifically instructs Athena to create the table schema without copying any rows from oldtable. The other options are incorrect: CREATE TABLE newtable AS SELECT FROM oldtables; would create newtable with both the schema and all the data from oldtable, not an empty table. INSERT INTO newtable SELECT FROM oldtable; requires newtable to already exist and would populate it with data, not create an empty table. CREATE TABLE newtable (LIKE oldtable); is a PostgreSQL-specific syntax for creating a table with the same schema and is not directly supported by Athena (which uses Presto/Trino SQL).
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed