MySQL Demo Physical Data Model
MySQL Demo Physical Data Model
MySQL Demo Physical Data Model
1
Database model: MySQL demo physical data model, mysql
Table of contents
1. Model details 3
2. Tables 4
1.1. Table product 4
1.2. Table product_type 4
1.3. Table stock 4
1.4. Table shipment 4
1.5. Table client 5
1.6. Table city 5
1.7. Table country 5
1.8. Table shipment_details 6
1.9. Table shipment_type 6
1.10. Table payment_type 6
1.11. Table payment_data 6
1.12. Table payment_details 7
1.13. Table status_catalog 7
1.14. Table shipment_status 7
3. Views 9
2.1. View product_details 9
4. References 10
3.1. Reference stock_product 10
3.2. Reference product_product_type 10
3.3. Reference city_country 10
3.4. Reference client_city 10
3.5. Reference shipment_client 10
3.6. Reference shipmet_details_shipment 10
3.7. Reference shipmet_details_product 10
3.8. Reference shipment_shipment_type 10
3.9. Reference shipment_payment_type 11
3.10. Reference payment_data_payment_type 11
3.11. Reference payment_details_shipment 11
3.12. Reference payment_details_payment_data 11
3.13. Reference shipment_status_shipment 11
3.14. Reference shipment_status_status_catalog 11
5. Subject areas 12
2
Database model: MySQL demo physical data model, mysql
1. Model details
Model name:
MySQL demo physical data model
Version:
2.4
Database engine:
MySQL
Description:
3
Database model: MySQL demo physical data model, mysql
2. Tables
2.1. Table product
2.1.1. Columns
4
Database model: MySQL demo physical data model, mysql
shipment_type_id int
payment_type_id int
shipping_address text
billing_address text
products_price decimal(8,2)
delivery_cost decimal(8,2)
discount decimal(8,2)
final_price decimal(8,2)
5
Database model: MySQL demo physical data model, mysql
6
Database model: MySQL demo physical data model, mysql
2.11.1. Columns
7
Database model: MySQL demo physical data model, mysql
shipment_id int
status_catalog_i int
d
status_time timestamp
notes text null
8
Database model: MySQL demo physical data model, mysql
3. Views
3.1. View product_details
SQL:
SELECT
p.id,
p.product_name,
p.product_description,
pt.type_name,
p.unit,
p.price_per_unit,
s.in_stock,
s.last_update_time
FROM product p
LEFT JOIN product_type pt ON p.product_type_id = pt.id
LEFT JOIN stock s ON p.id = s.product_id;
3.1.1. Columns
9
Database model: MySQL demo physical data model, mysql
4. References
4.1. Reference stock_product
product 0..* stock
id <-> product_id
10
Database model: MySQL demo physical data model, mysql
11
Database model: MySQL demo physical data model, mysql
5. Areas
5.1. Product subject area
5.1.1. Tables
- product
- product_type
- stock
5.1.2. Views
- product_details
5.1.3. References
- stock_product
- product_product_type
- city_country
- client_city
- shipment_client
- shipmet_details_shipment
- shipmet_details_product
- shipment_shipment_type
- shipment_payment_type
- payment_data_payment_type
- payment_details_shipment
- payment_details_payment_data
- shipment_status_shipment
- shipment_status_status_catalog
12
Database model: MySQL demo physical data model, mysql
- shipmet_details_shipment
- shipmet_details_product
- shipment_shipment_type
- shipment_payment_type
- payment_data_payment_type
- payment_details_shipment
- payment_details_payment_data
- shipment_status_shipment
- shipment_status_status_catalog
13
Database model: MySQL demo physical data model, mysql
- client_city
- shipment_client
- shipmet_details_shipment
- shipmet_details_product
- shipment_shipment_type
- shipment_payment_type
- payment_data_payment_type
- payment_details_shipment
- payment_details_payment_data
- shipment_status_shipment
- shipment_status_status_catalog
14