In-depth understanding of database design and database
As the saying goes: "Let's review the previous knowledge points. New knowledge can be used as a teacher!
01. What are common Aggregate functions?
Avg (): calculates the average value.
Sum (): Sum
Max (); returns the maximum value.
Min (): Minimum value
Count (): calculates the total number of records. count (1) is equivalent to count (*). It is generally considered that count (1) is highly efficient.
02. What types of table join are available?
Internal Connection, external connection, and cross-connection (Database principle)
Let's learn new knowledge together!
I. Databases
1. Why design a database?
First, good database design:
01. Data Storage space saved
02. ensure data integrity
03. Convenient development of database application systems
Poor Database Design:
01. data redundancy and storage space waste
02. memory space waste
03. Data Update and insertion exceptions
Therefore, we come to the conclusion that when the database is complex, we need to design the database.
2. Let us understand the elements of E-R Diagram
E--R Diagram:
Ing base:
It can be divided into the following categories:
One-to-one: a car can only correspond to one parking space
One-to-multiple: one room can accommodate multiple guests
Multiple to one: multiple guests can stay in one room
Many-to-many: A book can be picked up by multiple people. One person can also borrow multiple books.
Iii. standardized database design with three major paradigms
First paradigm: ensures the atomicity of each column and cannot be split.
Second paradigm: On the basis of satisfying the first paradigm, one table can only describe one thing
Third paradigm: On the basis of satisfying the second paradigm, all columns except primary key columns depend on the primary key directly.
You need to strike a balance between standardization and performance.
What have you learned after the consolidation?