当前位置:网站首页>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 )
边栏推荐
- Video networkstate property
- Acid transaction theory
- Instance + source code = see through 128 traps
- Why learn harmonyos and how to get started quickly?
- Learn the garbage collector of JVM -- a brief introduction to Shenandoah collector
- Semantic segmentation experiment: UNET network /msrc2 dataset
- Detailed steps for upgrading window mysql5.5 to 5.7.36
- Resnet18 actual battle Baoke dream spirit
- MySQL data table operation DDL & data type
- 信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
猜你喜欢

Implementing Yang Hui triangle with cyclic queue C language

Mmclassification training custom data

Summary of C language learning problems (VS)

Yum only downloads the RPM package of the software to the specified directory without installing it

NPM install reports an error

Select drop-down box realizes three-level linkage of provinces and cities in China

7月华清学习-1

Matlab superpixels function (2D super pixel over segmentation of image)

One article tells the latest and complete learning materials of flutter

Understand kotlin from the perspective of an architect
随机推荐
什么是数字化存在?数字化转型要先从数字化存在开始
Hexadecimal conversion summary
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
MySQL multi table operation
Recyclerview paging slide
Matlab imoverlay function (burn binary mask into two-dimensional image)
Halcon template matching actual code (I)
Pytoch through datasets Imagefolder loads datasets directly from files
ZABBIX 5.0 - LNMP environment compilation and installation
A new WiFi option for smart home -- the application of simplewifi in wireless smart home
IPv6与IPv4的区别 网信办等三部推进IPv6规模部署
Seven polymorphisms
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Experimental design - using stack to realize calculator
Just a coincidence? The mysterious technology of apple ios16 is actually the same as that of Chinese enterprises five years ago!
Swift - add navigation bar
Anaconda creates a virtual environment and installs pytorch
Constructing expression binary tree with prefix expression
ZABBIX customized monitoring disk IO performance
Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)