Complete the code to attach a partition named 'sales_2023' to the parent table 'sales'.
ALTER TABLE sales [1] PARTITION sales_2023 FOR VALUES FROM ('2023-01-01') TO ('2024-01-01');
The ATTACH PARTITION command is used to attach an existing table as a partition to a parent table.
Complete the code to detach the partition named 'sales_2022' from the parent table 'sales'.
ALTER TABLE sales [1] PARTITION sales_2022;The DETACH PARTITION command removes a partition from its parent table without dropping the partition table itself.
Fix the error in the code to correctly attach the partition 'orders_2024' to 'orders' table.
ALTER TABLE orders [1] PARTITION orders_2024 FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
The correct keyword to attach a partition is ATTACH. Using other keywords causes syntax errors.
Fill in the blank to detach partition 'archive_2020' from 'archive' table and keep the data intact.
ALTER TABLE archive [1] PARTITION archive_2020;The DETACH PARTITION command removes a partition from its parent table without dropping the partition table itself. The data remains intact in the standalone table.
Fill all three blanks to attach partition 'logs_2023' to 'logs' table with correct value range.
ALTER TABLE logs [1] PARTITION logs_2023 FOR VALUES FROM ([2]) TO ([3]);
The command to attach is ATTACH. The value range must specify the start and end dates as strings in single quotes.