Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam DP-203 All Questions

View all questions & answers for the DP-203 exam

Exam DP-203 topic 1 question 3 discussion

Actual exam question from Microsoft's DP-203
Question #: 3
Topic #: 1
[All DP-203 Questions]

DRAG DROP -
You have a table named SalesFact in an enterprise data warehouse in Azure Synapse Analytics. SalesFact contains sales data from the past 36 months and has the following characteristics:
✑ Is partitioned by month
✑ Contains one billion rows
✑ Has clustered columnstore index
At the beginning of each month, you need to remove data from SalesFact that is older than 36 months as quickly as possible.
Which three actions should you perform in sequence in a stored procedure? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Step 1: Create an empty table named SalesFact_work that has the same schema as SalesFact.
Step 2: Switch the partition containing the stale data from SalesFact to SalesFact_Work.
SQL Data Warehouse supports partition splitting, merging, and switching. To switch partitions between two tables, you must ensure that the partitions align on their respective boundaries and that the table definitions match.
Loading data into partitions with partition switching is a convenient way stage new data in a table that is not visible to users the switch in the new data.
Step 3: Drop the SalesFact_Work table.
Reference:
https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-tables-partition

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
hsetin
Highly Voted 3 years, 2 months ago
Given answer D A C is correct.
upvoted 47 times
svik
3 years, 2 months ago
Yes. Once the partition is switched with an empty partition it is equivalent to truncating the partition from the original table
upvoted 4 times
...
...
vigilante89
Highly Voted 1 month, 3 weeks ago
The answer should be D --> A --> C. Step 1: Create an empty table SalesFact_Work with same schema as SalesFact. Step 2: Switch the partition (to be removed) from SalesFact to SalesFact_Work. The syntax is: ALTER TABLE <source table> SWITCH PARTITION <partition number> to <destination table> Step 3: Delete the SalesFact_Work table.
upvoted 12 times
...
vrodriguesp
Most Recent 1 month, 3 weeks ago
Given answer is correct: Step 1: Create an empty table SalesFact_Work with same schema as SalesFact (that it will contains reocords older than 3 years) Step 2: Switch the partition from SalesFact to SalesFact_Work. SO we're only doing metadata operations Step 3: Delete the SalesFact_Work table containing stale data and we're not losing any time or blocking target table
upvoted 4 times
...
the_frix
1 month, 3 weeks ago
"Partition switching can be used to quickly remove or replace a section of a table. For example, a sales fact table might contain just data for the past 36 months. At the end of every month, the oldest month of sales data is deleted from the table. This data could be deleted by using a delete statement to delete the data for the oldest month. However, deleting a large amount of data row-by-row with a delete statement can take too much time, as well as create the risk of large transactions that take a long time to rollback if something goes wrong. A more optimal approach is to drop the oldest partition of data. Where deleting the individual rows could take hours, deleting an entire partition could take seconds." https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-tables-partition#benefits-to-loads
upvoted 5 times
...
nani191
2 months ago
FOR 3RD STEP: why should we drop the table instead of truncating? so that we can use it for subsequent months right?
upvoted 1 times
...
PavanPusarapu
7 months, 1 week ago
Is given answer correct (D, A, C) ?
upvoted 1 times
...
valenrami5
7 months, 3 weeks ago
Why not use 'ALTER TABLE' to avoid the need for creating a new table next time and simply switch the partition instead?
upvoted 1 times
...
kkk5566
1 year, 2 months ago
correct
upvoted 1 times
...
rocky48
1 year, 4 months ago
Given answer - Options D A C are correct.
upvoted 2 times
...
UzairMir
1 year, 6 months ago
Hi Can someone tell me why we cannot simply execute a delete statement? Thanks
upvoted 3 times
Xarvastia
1 year, 6 months ago
DELETE is intensive for a database to run. The solution should be faster as possible.
upvoted 3 times
...
Aaron1234
1 year, 6 months ago
https://learn.microsoft.com/en-us/training/modules/analyze-optimize-data-warehouse-storage-azure-synapse-analytics/10-understand-rules-for-minimally-logged-operations
upvoted 2 times
...
...
Dusica
1 year, 10 months ago
D A C IS CORRECT
upvoted 2 times
...
Jawidkaderi
2 years, 1 month ago
very interesting questions: Every partition has a name, which indicated by the mmYYYY perhaps. So, if we know the name of the partition, we can drop that partition directly: DROP PARTITION SCHEME partition_scheme_name [ ; ] However, if there is an index on the table DOPR Partition will not work. So, the it is correct. DAC.
upvoted 1 times
...
pmc08
2 years, 2 months ago
Answer is F - A - C https://docs.microsoft.com/es-es/archive/blogs/apsblog/azure-sql-dw-performance-ctaspartition-switching-vs-updatedelete
upvoted 2 times
pmc08
2 years, 2 months ago
D is incorrect because we also need to copy the data onto the new table
upvoted 1 times
...
supriyako
2 years, 1 month ago
F seems wrong as it says CTAS to copy the data
upvoted 1 times
...
...
Deeksha1234
2 years, 3 months ago
correct ans.
upvoted 2 times
...
mkthoma3
2 years, 5 months ago
D,A,C Azure Synapse does not support truncating partitions. Currently, that is feature is only tied to MS SQL Server.
upvoted 1 times
...
Dothy
2 years, 6 months ago
Step 1: Create an empty table named SalesFact_work that has the same schema as SalesFact. Step 2: Switch the partition containing the stale data from SalesFact to SalesFact_Work. Step 3: Drop the SalesFact_Work table.
upvoted 1 times
...
JJdeWit
2 years, 7 months ago
D A C is the right option. For more information, this doc discusses exactly this example: https://docs.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-tables-partition
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...