ACD301 practice question 9 of 10

As part of an upcoming release of an application, a new nullable field is added to a table that contains customer dat a. The new field is used by a report in the upcoming release and is calculated using data from another table. Which two actions should you consider when creating the script to add the new field?

Full set: 45 questions
Answer options
A: Create a script that adds the field and leaves it null.
B: Create a rollback script that removes the field. Correct answer
C: Create a script that adds the field and then populates it. Correct answer
D: Create a rollback script that clears the data from the field.
E: Add a view that joins the customer data to the data used in calculation.
Correct Answer:
B. Create a rollback script that removes the field.; C. Create a script that adds the field and then populates it.
Explanation

A robust deployment strategy for database changes involves two key components. First, the forward-migration script must bring the database to the required state for the new application version. This includes not only adding the new field (schema change) but also populating it with the necessary calculated data (data change), ensuring the new report functions correctly immediately after deployment. Second, a corresponding rollback script is crucial. This script should completely reverse the changes—in this case, by removing the newly added field—to restore the database to its previous state if the deployment fails or needs to be reverted. This ensures a clean and predictable state for the older application version.

Why Incorrect

A. This is an incomplete action. The new report requires calculated data, and leaving the field null would render the report non-functional or inaccurate upon release.
D. This is an incomplete rollback. A proper rollback should revert schema changes, not just clear data, to avoid leaving unused, orphaned columns in the database.
E. This suggests an alternative architectural approach (using a view) rather than addressing the specific task of creating a script to add a field as requested.

References

1. Appian Documentation, "Preparing Deployment Packages": This section details the necessary components for a deployment, including database scripts. It states, "If your deployment package contains database scripts, you may also want to include scripts to revert the database changes." This directly supports the creation of a rollback script (B). The documentation also implicitly supports populating the data (C) as part of the forward script to ensure the application is in a working state post-deployment.

2. Appian Documentation, "Database Schema Best Practices": While discussing schema modifications, the documentation emphasizes maintaining data consistency and integrity. A script that adds a column and immediately populates it with required data (C) aligns with the principle of ensuring the database schema and data are in a consistent state that supports the application's functionality.

3. Martin Fowler, "Evolutionary Database Design": This foundational text on database change management, widely referenced in academic and professional software engineering contexts, establishes the principle of having both forward-migration and reverse-migration (rollback) scripts for every database change. This supports both creating a script to apply the change (C) and a script to revert it (B) as a standard best practice. (Fowler, M. & Pramod, S. (2016). Evolutionary Database Design).

Scroll to Top