当前位置:网站首页>Introduction to relational model theory
Introduction to relational model theory
2022-07-05 12:30:00 【yang881221】
as everyone knows , Relational databases occupy a large share in the database market . Relational database has a solid theoretical foundation ---- Relational models and relational algebra .
The following is a brief summary of relational models and relational algebra , As the basis for subsequent understanding and learning of relational databases .
Relational databases deal with structured data , To be clear, it is to deal with data with fixed format , Table is its representative , So a relational database is a collection of tables ( Set theory )
1. The basic structure
attribute : A column in the table
Domain : The value range of an attribute value in the table
Relationship : A subset of Cartesian products over a series of fields ( surface )
Tuples : One line of the table
Tuple variables : Variables representing tuples
database schema : Design logic of database
Relationship model : Normal is the definition of the database table ---DDL( Such as mysql System table in information.schema,performance.schema)
Database instance : A snapshot of database data at a given time ( Multi table and multi database )
Relationship instance : The value of the specific mode , That is, the value of the table at that time .
Main code : Candidate codes that distinguish tuples in the same relationship
Hypercode : A collection of one or more attributes , The combination of these attributes can make it uniquely identify a tuple in the relationship .
Candidate code : Small value of super code .
Here, the specific database is the database key,primary key etc. .
The specification of code represents the constraints of the modeled thing in the real world .
Outer code : A relational schema may contain the main code of another relational schema in its attributes ( Foreign keys , Referential integrity , Reference relationship )
Pattern : For the design of specific patterns and the relationship between patterns .
query language : The language that users use to get information from a database . It is divided into process and non process
Process : Operation must have results ( The practical application )
Non procedural : The operation only needs to describe the information , But there is no need to give the specific process of obtaining this information ( Theoretical deduction )
In reality, it is often a combination of the two. For example, we delay materialization , That is to try to be non procedural first , Finally, process , Because the process involves the acquisition of data , Compare the consumption of resources .
2. Basic operations of relational algebra
choice (select): Select the tuple that satisfies the specified predicate .( Unary operation )
Projection (project): Return some attributes of the relationship as parameters ( duplicate removal )( Unary operation )
Set operations ---- Know from the previous knowledge , Relational databases are collections , So the knowledge use of set theory applies to it
and 、 Bad
The cartesian product
renamed ( Unary operation )
hand over
except
assignment ( Cannot increase the expressive ability of relational algebra , But it can make the expression of complex queries simple )
Natural join (natural join): Choose based on the equality of attributes that appear in both relationship patterns , Finally go to heavy -- Simply put, there are equal attributes in the two relationships, which are ties , Just combine the elements of these equal attributes and remove the duplication , The semantics are simple .
3. Extended relational algebra operation
Generalized projection : Projection plus aggregation
Aggregation function :
sum,min,max,avg,count etc.
External connection :
The left outer join : Based on the relationship on the left , To match with the tuple of the right relation , Mismatched additions null
Right connection : Based on the relationship on the right ....
Full outer join : All combinations of left-right relationships , Fill in the blank null
Null processing ---- Null value is an indeterminate , As long as it is calculated with a null value, it is null , Null value and null value are logically considered the same .
Database modification
Delete , Insert , to update ( Real database single operation, batch operation, etc )
边栏推荐
- Ecplise development environment configuration and simple web project construction
- How to recover the information server and how to recover the server data [easy to understand]
- End to end neural network
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- Want to ask, how to choose a securities firm? Is it safe to open an account online?
- ZABBIX agent2 monitors mongodb nodes, clusters and templates (official blog)
- 语义分割实验:Unet网络/MSRC2数据集
- Codeforces Round #804 (Div. 2)
- MVVM framework part I lifecycle
- Pytoch implements tf Functions of the gather() function
猜你喜欢
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter

Master the new features of fluent 2.10

Select drop-down box realizes three-level linkage of provinces and cities in China
![[figure neural network] GNN from entry to mastery](/img/e2/bb045fb03bc255b8659f9ca7cdd26b.jpg)
[figure neural network] GNN from entry to mastery

Average lookup length when hash table lookup fails

16 channel water lamp experiment based on Proteus (assembly language)

Understand kotlin from the perspective of an architect
自动化测试生命周期

Redis clean cache

Resnet18 actual battle Baoke dream spirit
随机推荐
Take you two minutes to quickly master the route and navigation of flutter
Matlab superpixels function (2D super pixel over segmentation of image)
Introduction to GNN
How does MySQL execute an SQL statement?
MVVM framework part I lifecycle
Matlab label2idx function (convert the label matrix into a cell array with linear index)
MySQL basic operation -dql
语义分割实验:Unet网络/MSRC2数据集
16 channel water lamp experiment based on Proteus (assembly language)
Pytoch monolayer bidirectional_ LSTM implements MNIST and fashionmnist data classification
Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password
[HDU 2096] 小明A+B
Pytoch through datasets Imagefolder loads datasets directly from files
byte2String、string2Byte
II. Data type
Summary of C language learning problems (VS)
Check the debug port information in rancher and do idea remote JVM debug
Solve the problem of cache and database double write data consistency
7月华清学习-1
Pytoch uses torchnet Classerrormeter in meter