I'm creating a conceptual data model for a simplified web store using Power Designer.
I'm having trouble specifying the relation between an Order and a Receipt. I would like a receipt to only have a part of the order's identifier in its primary key in the logical model (more specifically, only order_id
). I am unable to achieve this by tweaking the relationship properties (see the screenshots bellow; the problematic relationship is marked with a green arrow).
Should I simply omit the relation in the conceptual model?
Conceptual data model
Logical data model
EDIT
If perhaps it wasn't clear how I envisioned my tables…
User
username | password | first_name | last_name | address | |
---|---|---|---|---|---|
hacker123 | greenGrass | david.norton@gmail.com | David | Norton | West Shire 40, 1240 Neverland |
musicman100 | SuperPassword | john.stewart@gmail.com | John | Stewart | Strange Alley 50, 1250 Outer Space |
Product
product_id | name | description | price_per_unit | unit_of_measure | supply |
---|---|---|---|---|---|
1 | Tooth Brush 100 | NULL | 5.99 | piece | 200 |
2 | Super Paste 200 | For sparkling smiles | 7.99 | piece | 50 |
Order
order_id | username | product_id | amount |
---|---|---|---|
50 | hacker123 | 1 | 2 |
50 | hacker123 | 2 | 1 |
51 | musicman100 | 1 | 5 |
Receipt
receipt_id | order_id |
---|---|
12 | 50 |
13 | 51 |
EDIT #2
I just realised that I should probably break up Order into two tables! One to track which products are on a particular order, and another to track who placed the order.
Perhaps I could even split the Order table into 3 parts
Order(order_id, order_time)
ProductsPerOrder(order_id, product_id, amount)
OrdersPlaced(order_id, username)