DP-203 Exam QuestionsBrowse all questions from this exam

DP-203 Exam - Question 3


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 Answer
Correct 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

Discussion

31 comments
Sign in to comment
hsetin
Sep 8, 2021

Given answer D A C is correct.

svik
Sep 8, 2021

Yes. Once the partition is switched with an empty partition it is equivalent to truncating the partition from the original table

vigilante89
Sep 23, 2024

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.

the_frix
Sep 23, 2024

"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

AvithK
Aug 10, 2021

truncate partition is even quicker, why isn't that the answer, if the data is dropped anyway?

BlackMal
Aug 13, 2021

This, i think it should be the answer

yolap31172
Oct 11, 2021

There is no way to truncate partitions in Synapse. Partitions don't even have names and you can't reference them by value.

covillmail
Oct 27, 2021

DAC is correct

vrodriguesp
Sep 23, 2024

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

UzairMir
Apr 27, 2023

Hi Can someone tell me why we cannot simply execute a delete statement? Thanks

Xarvastia
May 9, 2023

DELETE is intensive for a database to run. The solution should be faster as possible.

Aaron1234
May 11, 2023

https://learn.microsoft.com/en-us/training/modules/analyze-optimize-data-warehouse-storage-azure-synapse-analytics/10-understand-rules-for-minimally-logged-operations

poornipv
Jul 29, 2021

what is the correct answer for this?

SabaJamal2010AtGmail
Dec 29, 2021

Given answer is correct

indomanish
Jan 6, 2022

Partition switching help us in loading large data set quickly . Not sure if it will help in purging data as well.

RamGhase
Feb 7, 2022

i could not understand how answer handled to remove data before 36 month

gerard
Feb 10, 2022

you have to move the partitions that contains the date before 36 months

Deeksha1234
Aug 13, 2022

correct ans.

pmc08
Aug 27, 2022

Answer is F - A - C https://docs.microsoft.com/es-es/archive/blogs/apsblog/azure-sql-dw-performance-ctaspartition-switching-vs-updatedelete

pmc08
Aug 27, 2022

D is incorrect because we also need to copy the data onto the new table

supriyako
Oct 20, 2022

F seems wrong as it says CTAS to copy the data

Dusica
Jan 14, 2023

D A C IS CORRECT

rocky48
Jul 8, 2023

Given answer - Options D A C are correct.

wfrf92
May 9, 2021

Is this correct ????

alain2
May 18, 2021

Yes, it is. https://www.cathrinewilhelmsen.net/table-partitioning-in-sql-server-partition-switching/

YipingRuan
Oct 10, 2021

"Archive data by switching out: Switch from Partition to Non-Partitioned" ?

TorbenS
May 18, 2021

yes, I think so

YipingRuan
Oct 10, 2021

"Archive data by switching out: Switch from Partition to Non-Partitioned" ?

Dileepvikram
May 29, 2021

The data copy to back up table is not mentioned in the answer

savin
Jun 21, 2021

partition switching part covers it. So its correct i think

dragos_dragos62000
Jul 1, 2021

Correct!

AnonAzureDataEngineer
Jul 25, 2021

Seems like it should be: 1. E 2. A 3. C

PallaviPatel
Jan 25, 2022

D A C is correct.

theezin
Apr 3, 2022

Why not included deleting sales data older than 36 months which is mentioned in question?

JJdeWit
Apr 14, 2022

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

Dothy
May 11, 2022

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.

mkthoma3
Jun 2, 2022

D,A,C Azure Synapse does not support truncating partitions. Currently, that is feature is only tied to MS SQL Server.

Jawidkaderi
Sep 29, 2022

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.

kkk5566
Aug 29, 2023

correct

valenrami5
Mar 31, 2024

Why not use 'ALTER TABLE' to avoid the need for creating a new table next time and simply switch the partition instead?

PavanPusarapu
Apr 15, 2024

Is given answer correct (D, A, C) ?

nani191
Sep 19, 2024

FOR 3RD STEP: why should we drop the table instead of truncating? so that we can use it for subsequent months right?

EmnCours
Nov 26, 2024

FAC is correct https://learn.microsoft.com/fr-fr/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-tables-partition

technoguy
Mar 26, 2025

DAC is simpler abd best approah here