当前位置:网站首页>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 )
边栏推荐
- Select drop-down box realizes three-level linkage of provinces and cities in China
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- End to end neural network
- Learning JVM garbage collection 06 - memory set and card table (hotspot)
- Ecplise development environment configuration and simple web project construction
- PIP command reports an error pip is configured with locations that requires tls/ssl problems
- 想问问,如何选择券商?在线开户是很安全么?
- C language structure is initialized as a function parameter
- Learn the memory management of JVM 03 - Method area and meta space of JVM
- Conversion du format de données GPS [facile à comprendre]
猜你喜欢

Get the variable address of structure member in C language

Tabbar configuration at the bottom of wechat applet
![[figure neural network] GNN from entry to mastery](/img/e2/bb045fb03bc255b8659f9ca7cdd26b.jpg)
[figure neural network] GNN from entry to mastery
[email protected] (using password"/>Solve the error 1045 of Navicat creating local connection -access denied for user [email protected] (using password

Get all stock data of big a
自动化测试生命周期

Keras implements verification code identification

Seven ways to achieve vertical centering

Linux Installation and deployment lamp (apache+mysql+php)

Four operations and derivative operations of MATLAB polynomials
随机推荐
How to clear floating?
MySQL basic operation -dql
MySQL multi table operation
Principle and performance analysis of lepton lossless compression
[HDU 2096] 小明A+B
MySQL installation, Windows version
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Time tools
Video networkState 属性
Clear neo4j database data
Which domestic cloud management platform manufacturer is good in 2022? Why?
Learning JVM garbage collection 06 - memory set and card table (hotspot)
语义分割实验:Unet网络/MSRC2数据集
Understand redis persistence mechanism in one article
Swift - add navigation bar
MVVM framework part I lifecycle
Linux Installation and deployment lamp (apache+mysql+php)
MySQL transaction
Array cyclic shift problem
PIP command reports an error pip is configured with locations that requires tls/ssl problems