Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Table company {
- id int PK
- address_id int
- name varchar
- }
- Table department {
- id int PK
- name varchar
- parent_department_id int
- company_id int
- }
- Table address {
- id int PK
- street varchar
- house_number varchar
- apartment_number int
- zip_code varchar
- country varchar
- }
- Table email {
- id int PK
- value varchar
- }
- Table telephone {
- id int PK
- value varchar
- type varchar
- }
- Table employee {
- id int PK
- first_name varchar
- last_name varchar
- }
- // tabele n:m
- Table employee_emial_link {
- id int PK
- employee_id int
- email_id int
- }
- Table employee_telephone_link {
- id int PK
- employee_id int
- telephone_id int
- }
- Ref: company.address_id > address.id
- Ref: department.parent_department_id > department.id
- Ref: department.company_id > company.id
- Ref: employee_emial_link.employee_id > employee.id
- Ref: employee_emial_link.email_id > email.id
- Ref: employee_telephone_link.employee_id > employee.id
- Ref: employee_telephone_link.telephone_id > telephone.id
- // Ref: orders.user_id > users.id
- // Ref: order_items.order_id > orders.id
- // Ref: order_items.product_id > products.id
- // Ref: products.merchant_id > merchants.id
- // Ref: users.country_code > countries.code
- // Ref: merchants.admin_id > users.id
- // Ref: merchants.country_code > countries.code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement