Steps to design a database
1. Fully understand the requirements document
2. Extracting entities from the requirements document
- Entity: is the real thing (noun)
3. Extract the attributes of each entity through demand
- attribute of an entity: is the description of the entity and its characteristics
4. Analyze relationships between entities to establish relationships
- The relationship between entities: the connection between the existence of things and things
5. Convert the relationship between entity and attribute table to e-r diagram
- Rectangles represent entities
- Ellipse represents an attribute of an entity
- Diamonds represent relationships between entities
6. Convert an entity to a table structure
- Entity name: is the table name
- Entity attribute: is its field
7. Set the primary key for each table according to needs and needs, set the relationship between the tables, etc.
MySQL's design database