
Explanation:
CTAS (Create Table As Select) allows you to create a new table by selecting and transforming data from an existing table. For example, you can use the following SQL command to create a new table 'recent_transactions' from an existing 'transactions' table, filtering for transactions from the last month: 'CREATE TABLE recent_transactions AS SELECT * FROM transactions WHERE transaction_date >= current_date - interval 1 month;'
No comments yet.
Explain the concept of CTAS (Create Table As Select) in the context of Delta Lake. Provide an example of how you would use CTAS to create a new table from an existing table while applying a filter.
A
CTAS allows you to create a new table by copying the schema and data from an existing table without any modifications.
B
CTAS is used to delete tables and cannot be used to create new tables from existing ones.
C
CTAS allows you to create a new table by selecting and transforming data from an existing table. For example, you can use CTAS to create a new table with only the recent transactions from an existing 'transactions' table.
D
CTAS is used exclusively for renaming existing tables.