9.1 Data Model Analysis Ideas
1, the data content of each table record
The sub-module is familiar with the contents of each table record, which is equivalent to the process of learning the system requirements (functions).
2. Important field settings for each table
Non-null field, foreign key field
3. Relationship between database-level tables and tables
FOREIGN key relationships
4. Business relationship between table and table
When you analyze the business relationship between tables and tables, you must build on a business sense basis to analyze them.
9.2 Data Model Analysis
Users table User:
Record the user information of the purchased item
Order Form: Orders
Records the orders created by the user (orders for items purchased)
Order Schedule: OrderDetail:
The details of the order are recorded as information about the purchase of the goods
Product List: Items
Record the product information
A business relationship between a table and a table:
The analysis of the business relationship between tables and tables needs to be built on a business sense basis.
Analyze the business relationship between tables that have a relationship between data levels first:
Usre and Orders:
User---->orders: You can create multiple orders, one-to-many
Orders--->user: An order is created by only one user
Orders and OrderDetail:
Orders-àorderdetail: An order can include multiple order details, because an order can buy multiple items, each item's purchase information is recorded in the OrderDetail, a one-to-many relationship
Orderdetail--> Orders: An order detail can only be included in one order
OrderDetail and ITESM:
Orderdetail-àitesms: An order detail corresponds to one product information
Items--> OrderDetail: A product can be included in multiple order details, one-to-many
Re-analyze whether there is a business relationship between tables that do not have a relationship at the database level:
Orders and items:
Relationships can be established between orders and items through the OrderDetail table.
MyBatis Series -09-Order commodity data Model