当前位置:网站首页>Mysql database Chapter 1 Summary
Mysql database Chapter 1 Summary
2022-06-25 01:04:00 【Play in the clouds】
Basic concepts of database
What is database design ?
Database design is to integrate the data entities in the database and the relationship between these data entities , The process of planning and structuring
What are some aspects of good database design
- Efficient
- For further expansion
- It can be that application development becomes easier
The steps to design a database :
- Demand analysis stage : Analyze customers' business and data processing requirements
- Outline design stage : Drawing database E-R The diagram is used to communicate between the internal designers of the project team and the customers , Confirm the correctness and completeness of the requirement information
- Detailed design stage : take E-R Convert graph to multiple tables , Carry out logical design , Confirm the main foreign key of each table and apply the three paradigms of database design
- Code writing
- Run the test
- Deploy online
Regardless of the size and complexity of the database, we can refer to the following basic steps :
- To collect information
- Identifying entities
- Identify the details that each entity needs to store , Identity is an attribute of an entity
- Identify the relationship between entities
What is an entity :
Entities are generally nouns , An entity only describes one thing , Entities with the same meaning cannot be repeated .
Each different entity in the database has a corresponding table .
What is an attribute
Simply speaking , That is, the sub member information attribute contained in each entity subdivided is the column name in the entity , Each entity corresponds to a table , Each child member in the entity corresponds to each column in the table
Be careful : When decomposing entity attributes , Member information with the same meaning cannot be repeated
Identify the relationship between entities :
The relationship between entities
Database type
Relational database
The storage format can directly reflect the relationship between entities , Similar to the table created , There are complex relationships between tables .
Oracle 、Mysql 、DB2 、Microsoft SQL Server、 Microsoft Access etc.
Non relational database
Refers to distributed 、 Non relational 、 There is no guarantee that ACID Principle of data storage system .
MongoDb 、 redis 、 HBase、 Cloudant etc.
E-R chart
E-R(Entity-Relationship) Entity relation diagram
Entity
The so-called entity refers to the things in the world that have the characteristics and attributes to distinguish other things and are connected with other things .
An entity is a row of specific data in a table .
We often refer to the entire table as an entity .
attribute
Attribute corresponds to the column in the table , Can be understood as the characteristics of entities
contact
A relationship is an association between two or more entities
Entity set , rectangular
attribute , The ellipse
Contact set , The diamond
Connect attributes and entity sets or entity sets and association sets , A straight line
Mapping cardinality
The mapping cardinality represents the number of other entities associated with the entity by association , Corresponding entity set x and y The binary relationship between
one-on-one (1:1):x One of the entities in is at most related to y An entity Association in .
One to many (1:n):x One of the entities in can be associated with y Any number of entity associations in .
For one more (n:1):x An entity in can be associated with at most y An entity Association in ,y One of the entities in can be associated with x Any number of entity associations in .
Many to many (m:n):x One of the entities in can be associated with y Any number of entity associations in , vice versa .
Three paradigms
First normal form (Normal Formate ,1NF)
The goal of the first paradigm is to ensure the atomicity of each column . If each column ( Or each attribute value ) Are indivisible minimum data units ( Also known as the smallest atomic unit ), The first paradigm .
Second normal form (2NF)
On the basis of the first paradigm, go one step further , The goal is to ensure that every column in the table is related to the primary key , If the first relation satisfies the first normal form , And all columns except the primary key depend on the primary key , The second paradigm is satisfied
Just describe one thing
Third normal form (3NF)
Follow up on the second paradigm , The goal of the third paradigm is to ensure that each column is directly related to the primary key column , Not indirectly , If the first relation satisfies the second normal form , Besides the primary key, other columns can only depend on the primary key column , There is no interdependency between columns , The third paradigm is satisfied
Simply speaking , It depends on the primary key , Changes with the primary key , When the primary key changes, the contents of the column also change .
边栏推荐
- 热力图展示相关矩阵
- 在企业级开发过程中我发现有位同事用select * from where 条件 for update
- 图书馆管理系统代码源码(php+css+js+mysql) 完整的代码源码
- 51单片机多机通信
- 改造一下 BeanUtils,优雅的实现 List 数据拷贝
- Helm chart warehouse operation
- Activity startup process
- Sanic service startup failed
- The problem of multiple callback of video ads stimulated by applets (offcolse problem)
- Mobile security tool apktool
猜你喜欢

Network request -volley

Custom control - round dot progress bar (imitating one key acceleration in security guard)

Using tcp/udp tools to debug the yeelight ribbon

108页(4万字)未来公寓智能化设计平台项目方案建议书2022版

I brush the question I - copy the linked list with random pointer

Text border format and text block of rich text

Scala IO reads by lexical units and numbers

Infotnews | is the development of domestic NFT limited to digital collections?

If the order has not been paid for 30 minutes, it will be automatically cancelled. How can I achieve this?

Examination questions and mock examination for safety management personnel of hazardous chemical business units in 2022
随机推荐
打卡smart精灵#1,品牌不缺吸引力,产品本身实力如何?
Custom control - round dot progress bar (imitating one key acceleration in security guard)
Paint rounded rectangle
Solution to network access packet loss of Tencent cloud international ECS
热力图展示相关矩阵
Qiniu cloud uploads video to get the first frame of video
【Redis实现秒杀业务④】一人一单,不可重复购买
通过kubernetes可视化界面(rancher)安装kibana
2022年危险化学品经营单位安全管理人员考试试题及模拟考试
【微服务|Sentinel】实时监控|RT|吞吐量|并发数|QPS
QT(35)-操作EXCEL-QXlsx-QAxObject
Can communication experiment between C and C
[redis realizes seckill business ③] specific implementation of optimistic lock for oversold problem
Use of navigation and navigationui
Scala IO read by character
Sanic服务启动失败
2022r1 quick opening pressure vessel operation test questions and answers
启动服务11111
2022 crane driver (limited to bridge crane) examination question bank simulated examination platform operation
2022熔化焊接与热切割复训题库模拟考试平台操作