83 lines
No EOL
1.6 KiB
Text
83 lines
No EOL
1.6 KiB
Text
// https://dbdiagram.io/d/
|
|
// Kraut&Rüben ERD
|
|
|
|
Table Customer {
|
|
id string [primary key]
|
|
address string
|
|
first_name string
|
|
last_name string
|
|
birth_date timestamp
|
|
email string
|
|
phone string
|
|
}
|
|
|
|
Table Order {
|
|
id string [primary key]
|
|
customer string
|
|
invoice_amount float
|
|
order_date timestamp
|
|
}
|
|
|
|
Table Ingredient {
|
|
id string [primary key]
|
|
designation string
|
|
stock integer
|
|
net_price float
|
|
unit string
|
|
carbohydrates float
|
|
calories integer
|
|
protein float
|
|
}
|
|
|
|
Table Supplier {
|
|
id string [primary key]
|
|
address string
|
|
email string
|
|
phone string
|
|
name string
|
|
}
|
|
|
|
Table Recipe {
|
|
id string [primary key]
|
|
preparation_time integer
|
|
name string
|
|
description string
|
|
instructions string
|
|
}
|
|
|
|
Table Address {
|
|
id string [primary key]
|
|
city string
|
|
street string
|
|
house_number string
|
|
postal_code string
|
|
}
|
|
|
|
Table RecipeContainsIngredients {
|
|
recipe string [primary key]
|
|
ingredient string [primary key]
|
|
amount integer
|
|
}
|
|
|
|
Table SupplierContainsIngredients {
|
|
supplier string [primary key]
|
|
ingredient string [primary key]
|
|
delivery_cost float
|
|
delivery_time integer
|
|
}
|
|
|
|
Table OrderContainsIngredients {
|
|
order string [primary key]
|
|
ingredient string [primary key]
|
|
quantity integer
|
|
}
|
|
|
|
Ref: Order.customer > Customer.id
|
|
Ref: Address.id - Customer.address
|
|
Ref: Address.id - Supplier.address
|
|
Ref: SupplierContainsIngredients.supplier > Supplier.id
|
|
Ref: SupplierContainsIngredients.ingredient > Ingredient.id
|
|
Ref: OrderContainsIngredients.order > Order.id
|
|
Ref: OrderContainsIngredients.ingredient > Ingredient.id
|
|
Ref: RecipeContainsIngredients.recipe > Recipe.id
|
|
Ref: RecipeContainsIngredients.ingredient > Ingredient.id |