In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. Database
Database is a system software that stores and manages data according to the data structure. The software system that manages the database is called database management system.
II. Relational database paradigm
It means that when designing a relational database, you should follow the design principles. By following these rules, a good relational database can be designed, which can avoid data redundancy, save data storage space and ensure data consistency.
The design paradigm of database mainly solves the following problems.
1. Emphasize that the columns in the relational database are inseparable
2. Reduce the redundancy of data in the database
3. Relational data will not cause data inconsistency because of the update of the data.
4. When inserting and deleting data, exceptions are not inserted and deleted.
5. When querying, the database structure of the designed database is reasonable.
The common paradigms in relational databases are: the first normal form (1NF), the second normal form (2NF), the third normal form (3NF), the fourth normal form (4NF), the fifth normal form (5NF), and BCNF.
(1) the first normal form (1NF): it means that each column of a relational database is an inseparable basic data item, and there cannot be multiple values in the same column. It ensures the non-repeatability of the data.
(2) the second normal form (2NF): in order to satisfy the second paradigm, we must first satisfy the first paradigm. In the second paradigm, it is required that each row in the database table must be uniquely distinguishable. In order to distinguish, the first or more attributes of the table are usually used as the unique identification of the row, which is called the primary key.
In the second paradigm, the column value of the required row is completely dependent on the primary keyword.
(3) the third normal form requires that there can be no dependencies between non-primary key columns of tables in the database. In other words, the third paradigm is mainly used to reduce data redundancy.
III. Affairs
Transaction refers to a sequence of database operations when the user is performing database operations. Either all or none of the operations in the operation sequence are performed. All operations are integrated and inseparable.
Concepts related to transactions are transaction commit and transaction rollback. When a transaction commits, it commits updates to the data in the transaction to the database. If executed correctly, the transaction ends. Otherwise, when an exception occurs, the transaction will roll back and restore the database state to the state before the transaction commits. The transaction rollback is mainly used to terminate the transaction and restore the database state in the case of transaction failure.
The characteristics of the transaction:
1. Atomicity: a transaction is a logical unit of work in which either all or none of the operations are performed.
2. Consistency, which means that the result of transaction execution must change the database from one consistent state to another. Therefore, the database contains only the result of a successful transaction commit, and the database is in a consistent state. If you commit a transaction and stop because of a failure, some of these outstanding transactions may have been performed and some data modifications have not been performed, and the database is in an inconsistent state.
3. Isolation: it means that data transactions cannot interfere with each other. That is, the internal operation of a transaction and its data are isolated from other concurrent transactions, and the concurrent transactions can not interfere with each other.
4. Persistence: means that once a transaction is committed, its changes to the data in the database are permanent.
IV. The reasons for the destruction of transaction characteristics
Multiple transactions are executed concurrently, and operations between transactions are executed across each other
The transaction is forcibly terminated during operation.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.