当前位置:网站首页>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 )
边栏推荐
- JS for loop number exception
- Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
- GNN(pytorch-geometric)
- 嵌入式软件架构设计-消息交互
- Is investment and finance suitable for girls? What financial products can girls buy?
- Basic operations of MySQL data table, addition, deletion and modification & DML
- Principle and performance analysis of lepton lossless compression
- What is digital existence? Digital transformation starts with digital existence
- Flutter2 heavy release supports web and desktop applications
- Third party payment interface design
猜你喜欢
Master the new features of fluent 2.10
Third party payment interface design
Understand redis persistence mechanism in one article
Embedded software architecture design - message interaction
Get the variable address of structure member in C language
ZABBIX customized monitoring disk IO performance
Linux Installation and deployment lamp (apache+mysql+php)
自动化测试生命周期
[superhard core] is the core technology of redis
mysql拆分字符串做条件查询
随机推荐
Implementing Yang Hui triangle with cyclic queue C language
Just a coincidence? The mysterious technology of apple ios16 is actually the same as that of Chinese enterprises five years ago!
ZABBIX 5.0 - LNMP environment compilation and installation
ABAP table lookup program
Average lookup length when hash table lookup fails
Pytoch through datasets Imagefolder loads datasets directly from files
Which domestic cloud management platform manufacturer is good in 2022? Why?
Image hyperspectral experiment: srcnn/fsrcnn
A new WiFi option for smart home -- the application of simplewifi in wireless smart home
JS for loop number exception
How to design an interface?
About cache exceptions: solutions for cache avalanche, breakdown, and penetration
Understand kotlin from the perspective of an architect
Take you hand in hand to develop a service monitoring component
ZABBIX monitors mongodb templates and configuration operations
Master the new features of fluent 2.10
ZABBIX customized monitoring disk IO performance
Is investment and finance suitable for girls? What financial products can girls buy?
Pytoch uses torchnet Classerrormeter in meter
[superhard core] is the core technology of redis