summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assignments/2/README.md21
1 files changed, 20 insertions, 1 deletions
diff --git a/assignments/2/README.md b/assignments/2/README.md
index 82494f9..f54f3ec 100644
--- a/assignments/2/README.md
+++ b/assignments/2/README.md
@@ -54,7 +54,26 @@ Answer the following questions (250 words max/question).
```
2. A many-to-many relationship with nonkey attributes
- * E.g.
+ ```text
+ Order(id: integer, customer_id: integer)
+ LineItem(id: integer, product_id: integer, order_id: integer, quantity: integer, purchase_price: decimal)
+ Product(id: integer, name: string, description: text, current_price: decimal)
+ ```
+
+ In order to display a customers order history it might make sense to denormalize the
+ relationships to make it easy to see the product name and description to capture these fields
+ as they were at the time of purchase.
+
+ This would ensure that the order history can display the name and description of the product
+ at the time of purchase rather than the current product name and description. The current
+ product name and description can change and may include or exclude information that was
+ available at the time of purchase.
+
+ ```text
+ Order(id: integer, customer_id: integer)
+ LineItem(id: integer, product_id: integer, order_id: integer, quantity: integer, purchase_price: decimal, name: string, description: text)
+ ```
+
3. Reference data
* E.g.