Soft test (software designer) test site summary -- database technology

Soft test (software designer) test site summary: https://blog.csdn.net/Lzy410992/article/details/117321579

Database Basics

Three-level mode - two-level mapping:
insert image description here

Three-tier model:
Internal mode: Corresponding to the storage file, it is directly related to the database at the physical level, and manages how to store this series of data. Conceptual
mode: corresponding to the data table, divide the data into several tables, according to the business/application...
.

Two-level mapping:
mode/internal mode mapping: realize the mutual conversion between conceptual mode and internal mode. (guarantee physical independence)
External mode/mode mapping: realize the mutual conversion between external mode and conceptual mode. (guarantee logical independence)

Shared lock: After transaction A adds a shared lock to data A, other transactions can only add shared locks to data A.
Exclusive lock: After transaction A adds an exclusive lock to data A, other transactions cannot lock data A.

JDBC: Java database connection is a Java API for executing SQL statements, which can provide unified access to various relational databases. It consists of a set of classes and interfaces written in the Java language. Execute: establish connection, send statement, process result

Database design process:
insert image description here

The setting of the database is mainly divided into four stages: user demand analysis, conceptual structure, logical structure, and physical structure.

Requirement analysis: Database designers use certain auxiliary tools to scientifically analyze the functions, performance, limitations and other requirements of application objects, and form: description documents, data dictionaries, and data flow charts. The documentation serves as the design basis for the conceptual design phase.
Conceptual structure design: The main form of expression is to make the ER model.
Logical structure design: Convert the ER model into a relational model, and the output is a relational model.
Physical Design Structure: After the relational schema, incorporate DBMS features.

Distributed database:

Basic features of DDBS:
Physical distribution: Data is not stored on one site, but on multiple sites on a computer network.
Logical integrity: Data is physically distributed in various sites, but is logically a whole, which is shared by all users and managed uniformly by a DDBMS.

Site autonomy: The data on each site is managed by the local DBMS, which has the ability to autonomously process and complete the application of the site.
Collaboration between sites: Although there is a high degree of autonomy between sites, they cooperate with each other to form a whole.

Fragmentation transparency: users or applications do not need to know how logically accessed tables are stored in blocks.
Replication transparency: Using the distribution method of replication technology, users do not need to know which nodes the data is replicated to and how it is replicated.
Location Transparency: Users do not need to know the physical location of data storage.
Logical transparency: The local data model is transparent, and the user or application does not need to know which data model the local site is using.

Database integrity constraints:

insert image description here

Entity Integrity Constraint: When using the database, define the primary key for the data table, and the constraint is the primary key (the primary key cannot be empty or repeated).
Referential integrity: Integrity constraints on foreign keys
User-defined Integrity: User-defined constraints.
Triggers: Scripts can be written to constrain database data requirements.

ER model

insert image description here

insert image description here

Example: insert image description here
Answer: C, 4, A, B, C each with a relationship pattern, and the middle connection has a relationship pattern

Relational Algebra: Union, Intersection, Difference, Cartesian Product (×), Projection (Π), Selection (σ), Concatenation (∞)

insert image description here
insert image description here
insert image description here

normalization theory

Functional Dependency:
insert image description here
Partial Functional Dependency: (A/B) One of the primary keys can determine the value of the C field.
Transfer function dependence, knowing that A can determine B, knowing that B can determine C, but B cannot determine A.

Value and use:
insert image description here

Find candidate keywords:
insert image description here

insert image description here

Example:
insert image description here
Answers: A, ABCD, B

Paradigm:
insert image description here

First Normal Form (1NF): Attributes are not splittable or have no repeating columns.
Second Normal Form (2NF): Complete functional dependencies. In a relationship, if a non-primary attribute data item depends on all keywords, it is called complete functional dependency.
Third Normal Form (3NF): Eliminate transitive dependencies. Does not depend on other non-primary properties. The second normal form needs to be satisfied before the third normal form is satisfied. The attribute dependencies in the database can only depend on the main attribute, and there is no association with other non-main attributes.
BC Normal Form (BCNF): All non-prime attributes are fully functionally dependent on every code; all primary attributes are also fully functionally dependent on every code that does not contain it; no attribute is fully functionally dependent on any combination of non-codes.
Fourth Normal Form (4NF): For every X->Y, X can find a candidate key.

As the level of the paradigm continues to increase, the degree of normalization is getting higher and higher, and it is more likely to solve the exception of insertion, deletion, and data redundancy.

Example Question:
insert image description here
Answers: C, D, A

insert image description here

When the paradigm level is not enough, the main strategy is to split the pattern, and after splitting, its level will go up.

Lossless decomposition: After splitting, a can be restored when
insert image description here
insert image description here
a represents that the current relational schema has the current attribute, and b means that the table does not have this attribute.
insert image description here
insert image description here
insert image description here
If one of R1∩R2 -> (R1 - R2) / R1∩R2 -> (R2 - R1) exists in the original dependency, it is a lossless decomposition.

Denormalize:
insert image description here

concurrency control

insert image description here
ACID principle:
A (Atomicty) atomicity: A transaction is an indivisible unit of work, and the operations in the transaction either all occur or none of them occur.
C (Consistency) Consistency: The integrity of the data before and after the transaction must be consistent.
I (Isolation) independence: When multiple users access the database concurrently, the transaction opened by the database for each user cannot be interfered by the operation data of other transactions, and multiple concurrent transactions must be isolated from each other.
D (Durability) Persistence: Once a transaction is committed, its changes to the data in the database are permanent, and even if the database fails, it should not have any effect on it.
insert image description here
insert image description here

database security

In order to protect the data in the database safe, reliable, correct and effective, the database management system DBMS provides functions such as database recovery, concurrency control, data integrity protection and data security protection.

Data storage and recovery:
Back up data regularly; when doing transaction processing, write the relevant content of data update into log files ; when the system is running normally, set checkpoint files at certain time intervals , and restore the contents of the memory buffer to the log file. The data not written to disk is recorded in the checkpoint file; when a failure occurs, the state of the system is restored according to the content of the field data, the pre-failure image of the log file, and the checkpoint file.

insert image description here
data backup:

insert image description here
insert image description here

insert image description here

Big data related

Big Data Basic Concepts:
insert image description here
insert image description here
Data Warehouse:
insert image description here
Data Mining:

insert image description here

The past real questions of the soft exam and related video courseware of station B:
link: https://pan.baidu.com/s/1e4d1-HGOzcEVHSK8Q0j_xA
Extraction code: acij

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324125600&siteId=291194637