Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Design A: one table for common elements and N tables for uncommon elements
- Table Product
- int product_id
- string brand_name
- number price
- number weight
- int product_type #1 for fish, 2 for bicycles
- int fish_or_bike_id #foreign key into either the fish table or bicycle table
- Table Fish
- int fish_id
- bool requires_salt_water
- Table Bicycle
- int bicycle_id
- int number_of_spokes
- Design B: everything in one table, even if it doesn't make sense
- Table Product
- int product_id
- string brand_name
- number price
- number weight
- int product_type #1 for fish, 2 for bicycles
- bool requires_saltwater #always False for bicycles
- int number_of_spokes #always 0 for fish
- Design C: no common tables whatsoever
- Table Fish
- int product_id
- string brand_name
- number price
- number weight
- bool requires_salt_water
- Table Bicycle
- int product_id
- string brand_name
- number price
- number weight
- int number_of_spokes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement