当前位置:网站首页>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 )
边栏推荐
- Why learn harmonyos and how to get started quickly?
- struct MySQL
- Migrate data from Mysql to neo4j database
- ABAP table lookup program
- Just a coincidence? The mysterious technology of apple ios16 is actually the same as that of Chinese enterprises five years ago!
- Solve the problem of cache and database double write data consistency
- Simple production of wechat applet cloud development authorization login
- GPS数据格式转换[通俗易懂]
- byte2String、string2Byte
- Conversion du format de données GPS [facile à comprendre]
猜你喜欢

Constructing expression binary tree with prefix expression

Solve the problem of cache and database double write data consistency
![[figure neural network] GNN from entry to mastery](/img/e2/bb045fb03bc255b8659f9ca7cdd26b.jpg)
[figure neural network] GNN from entry to mastery

Take you hand in hand to develop a service monitoring component
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases
Automated test lifecycle

Ecplise development environment configuration and simple web project construction

Tabbar configuration at the bottom of wechat applet

ZABBIX customized monitoring disk IO performance

MySQL index - extended data
随机推荐
Acid transaction theory
POJ-2499 Binary Tree
Complete activity switching according to sliding
struct MySQL
Take you hand in hand to develop a service monitoring component
ZABBIX ODBC database monitoring
Pytoch monolayer bidirectional_ LSTM implements MNIST and fashionmnist data classification
ACID事务理论
Interviewer: is acid fully guaranteed for redis transactions?
Deep discussion on the decoding of sent protocol
16 channel water lamp experiment based on Proteus (assembly language)
MySQL regular expression
Detailed structure and code of inception V3
强化学习-学习笔记3 | 策略学习
Time tools
Matlab superpixels function (2D super pixel over segmentation of image)
Third party payment interface design
Get data from the database when using JMeter for database assertion
Read and understand the rendering mechanism and principle of flutter's three trees
Design of music box based on assembly language