**1. What is a database migration? **
a) The process of upgrading the DBMS version
b) The process of making changes to a database's schema ← Correct
c) The process of optimizing existing SQL queries
d) None of the above.
Explanation:
A database migration includes changes that effects its schema, such as changes to the columns, tables and constraints.
Objective
Remember: Define a migration Understand: Explain how a migration changes the database
Covered in:
Modeling data relationships
**2. Which of the following would be considered a migration change? **
a)
DELETE FROM products
WHERE sku = '52983';
b)
INSERT INTO products
VALUES (103, 't-shirt', '12.99');
c)
ALTER TABLE products
ADD sku VARCHAR(20); ← Correct
d) None of the above.
Explanation:
A migration changes the database's schema. The correct answer uses the ALTER
statement to update the products
table by adding a new column called sku
.
Objective
Apply: Make a basic change to a migration
Covered in:
Modeling data relationships
**3. TBD **
a)
b)
c)
d)
Explanation:
Objective
Create: Use migrations to build a database containing tables for the data model
Covered in:
Modeling data relationships