Get the App
SLTechnology News&Howtos  ›  Database  › 

Collation of knowledge points in database 1

Shulou Source: shulou.com Published: 2022-06-01 15:00:18 10月06日 Update

I. basic concepts

Relational database: use two-dimensional tables to store data.

The relational model consists of three parts: relational data structure, relational operation set and relational integrity constraints.

Entity: something that exists objectively and can be distinguished in the real world. For example, "a student", "a book", "a course" and so on. It is worth emphasizing that the "things" mentioned here are not only visible and tangible "things", it can also be virtual, rather than "the relationship between teachers and schools".

Attribute: it is interpreted in the textbook as "a certain characteristic of an entity", so it can be seen that attribute is a logical concept at first, for example, "gender" is an attribute of "person". In a relational database, an attribute is also a physical concept, and an attribute can be regarded as a "column of a table".

Tuple: a row in a table is a tuple.

Component: a property value of a tuple. In a relational database, it is an operation atom, that is, when a relational database does any operation, the attributes are "inseparable". Otherwise, it's not a relational database.

Code: an attribute (or attribute group) of a tuple can be uniquely identified in the table. If there is more than one such code, then everyone is called a candidate code. If we choose one of the candidate codes to be the boss, it is called the main code.

Full code: if a code contains all the attributes, this code is the full code.

Primary attribute: as long as an attribute appears in any candidate, this attribute is the primary attribute.

Non-primary attribute: on the contrary, it does not appear in any candidate code, and this attribute is a non-primary attribute.

External code: an attribute (or attribute group), it is not a code, but its other table code, it is an external code.

Two and three paradigms

1NF: fields cannot be divided

2NF: there is a primary key, and non-primary key fields depend on the primary key

3NF: non-primary key fields cannot depend on each other

III. Affairs

1. Transaction: a concurrency control unit and a user-defined sequence of operations.

2. Four characteristics of the transaction (ACID feature):

(1) Atomicity: a transaction is the logical working unit of a database, and all the operations included in the transaction are either done or not done.

(1) Consistency: the result of transaction execution must be to change the database from one consistency state to another. Consistency is closely related to atomicity.

(3) Isolation: the execution of one transaction cannot be interfered with by other transactions.

(4) persistence / Durability: once a transaction is committed, its changes to the data in the database should be permanent.

3. Start implicitly, but each transaction still ends explicitly with COMMIT or ROLLBACK.

Tags: Attributes data transactions databases that is consistency atoms fields concepts properties things units entities permanence state or logic full code permanent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Docker Microsoft MariaDB MySQL