Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam Amazon-DEA-C01 Topic 4 Question 9 Discussion

Actual exam question for Amazon's Amazon-DEA-C01 exam
Question #: 9
Topic #: 4
[All Amazon-DEA-C01 Questions]

A data engineer needs to create a new empty table in Amazon Athena that has the same schema as an existing table named old-table.

Which SQL statement should the data engineer use to meet this requirement?

A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: D

Problem Analysis:

The goal is to create a new empty table in Athena with the same schema as an existing table (old_table).

The solution must avoid copying any data.

Key Considerations:

CREATE TABLE AS (CTAS) is commonly used in Athena for creating new tables based on an existing table.

Adding the WITH NO DATA clause ensures only the schema is copied, without transferring any data.

Solution Analysis:

Option A: Copies both schema and data. Does not meet the requirement for an empty table.

Option B: Inserts data into an existing table, which does not create a new table.

Option C: Creates an empty table but does not copy the schema.

Option D: Creates a new table with the same schema and ensures it is empty by using WITH NO DATA.

Final Recommendation:

Use D. CREATE TABLE new_table AS (SELECT * FROM old_table) WITH NO DATA to create an empty table with the same schema.


Athena CTAS Queries

CREATE TABLE Statement in Athena

Contribute your Thoughts:

Elvera
24 days ago
Option B looks like the way to go. It's like using a hammer to build a table - simple and effective!
upvoted 0 times
Lynelle
3 days ago
I agree, Option B is like using a hammer to build a table - simple and effective.
upvoted 0 times
...
Stefania
17 days ago
Option B is definitely the best choice. It's straightforward and gets the job done.
upvoted 0 times
...
...
Tawanna
27 days ago
I'm not sure, but I think Option A could also work. It looks like it's creating a new table based on the existing one.
upvoted 0 times
...
Cassandra
1 months ago
I agree with Lasandra. Option C seems like the right choice because it creates a new empty table with the same schema as the existing one.
upvoted 0 times
...
Nana
1 months ago
Option C seems a bit too complex for this task. I'd go with the simpler approach in Option A.
upvoted 0 times
...
Lasandra
1 months ago
I think the data engineer should use Option C.
upvoted 0 times
...
Nelida
1 months ago
Haha, Option D is like trying to build a house with a screwdriver. I don't think that's going to work.
upvoted 0 times
Linwood
5 days ago
Youlanda: Let's go with Option A or B instead.
upvoted 0 times
...
Youlanda
10 days ago
User 2: Yeah, it doesn't sound like the right tool for the job.
upvoted 0 times
...
Tijuana
16 days ago
User 1: I agree, Option D seems like a bad choice.
upvoted 0 times
...
...
Stephane
2 months ago
Option B looks good, but I'm not sure if it will create the table with the same schema as the existing one. Let's double-check the documentation.
upvoted 0 times
Shakira
19 days ago
I agree, let's double-check before making a decision.
upvoted 0 times
...
Penney
1 months ago
I think we should go with option C just to be safe.
upvoted 0 times
...
Jackie
1 months ago
Let's check the documentation to be sure.
upvoted 0 times
...
...

Save Cancel