The purpose of database
When many friends first started learning databases, it was difficult to understand the role of databases. It’s unclear what relationship the database has to our real life and virtual life.
We use this chapter to speed up beginners' understanding of databases and database systems.
Nowadays, everything we see that is related to daily life and needs to be recorded is basically placed in the database:
ID card information is placed in the system of the Ministry of Public Security
Bank card balances, transaction records, transfer information
Room booking information in the hotel (all databases that have been stolen in some way and information leakage)
Airline, train, car online ticket purchase records
Various websites, QQ, online shopping, post bars, likes Music and movie collection information
Mobile phone records, balance, bus card balance, water bill, electricity bill, lottery purchase record
Game equipment, level, magic, strength, attack ability and other information
US aircraft carriers are also using the mysql database to manage aircraft carrier related information
... ...and so on
Everything in our lives is recorded in the database. You can think about how important the database is!
In the 21st century, what will happen to the world if humans do not have databases?
Five basic units of database
Database Server
Database
Data Table
Data Field
Data row
We will now explain the above five basic units:
Database server . Refers to a computer used to run database services. In small and medium-sized enterprises, it is usually one unit. When the amount of data storage and calculation is very large, multiple units can exist. Multiple database servers work together to store or compute. Since data security is very important, we often back up the data in the database server.
database. There can be multiple databases in a database server. Mainly used for classification. We can build traffic information databases, game databases, hotel reservation databases... Mainly used to divide data for different purposes into large blocks according to business.
data sheet. For example in the game database. According to this game, it is divided into different data tables. Specifically used to distinguish different data in the game. For example: user data (user, password); character data; all equipment and equipment information; user's recharge information; medicine, magic potion information... etc.
Data field, also called data column. It is the columns in the tables we see every day. In the table, we will split a user table into columns. As shown below (Table 1): user number, user name, gender, and age are fields. In a real database, the data fields need to be changed to English and written as: id, username, sex, and age.
Data row. The real data exists in each table row. Fields (columns) divide the format in which a table should store data. And rows are real data. Each row needs to follow the specifications and requirements of the data fields (columns) to store data.