当前位置:网站首页>Database overview
Database overview
2022-06-25 04:54:00 【Cn Sirius】
Brief introduction of database
Show the world , The information world , Machine world
| Three worlds | Real world | The information world | Machine world |
|---|---|---|---|
| Yes | The individual of things | Entity | Record |
| Should be | Things as a whole | Entity set | file |
| Turn off | Characteristics of things | attribute | Field |
| system | The connection between things | conceptual model | Data model |
Three level mode Secondary independence Secondary image
Three level mode
| Three level mode | External mode | Pattern | Internal mode |
|---|---|---|---|
| Corresponding level | User level | Concept level | Physical level |
Enable users at different levels to form different views of the database .
Secondary image
External mode - Pattern
Ensure logical independence of data
There can be any number of external modes for the same mode , For every outer pattern , Database systems all have an external schema / Pattern image .
When the pattern changes , The database administrator controls each external mode / Change the image of the pattern accordingly , You can keep the outer mode unchanged . The application program is written in an external mode of data , So the application doesn't have to be modified , Ensure the independence of data and program , The logical independence of data .
Pattern - Internal mode
Ensure the physical independence of data and program , Physical independence of data .
There is only one schema in the database , There is only one internal mode , So the pattern / Internal mode image is unique . This image definition is usually included in the schema description
When the storage structure of the database changes ( That is, the internal mode changes ), The database administrator modifies the schema / Internal mode image , Leave the mode unchanged . Application is not affected , Ensure the physical independence of data and program , Physical independence of data .
Primary key Foreign keys
create table a(
a1 primary key,// Primary key
a2
);
create table b(
b1,
foreign key(b1) references a(a1),// Primary foreign key Association
);
The concept of code classification
Code is a basic concept in data system . A code is an attribute that uniquely identifies an entity , He is the property of the whole entity set , Not the nature of a single entity .
Definition of candidate code : If the value of an attribute group in the relationship can uniquely identify a primitive ancestor , The attribute group is called candidate code ;
Definition of master code : If a relationship has multiple candidates , Select one of the main codes ;
Main attribute definition : The attributes of candidate codes are called primary attributes ;
Non primary attribute definition : Attributes that are not included in any candidate code are called non primary attributes ;
Entity integrity rules : If the property ( An attribute or set of attributes )A It's the basic relationship R The main attribute of , be A Can't take null value .
边栏推荐
- Introduction to the hardest core PWN in the whole network_ Graphic analysis
- 本轮压力测试下,DeFi协议们表现如何?
- Laravel's little knowledge
- Join() in JSZ
- Machine learning deep learning -- Vectorization
- parallel recovery slave next change & parallel recovery push change
- The solution of wechat applet switchtab unable to take parameters
- Kotlin compose perfect todo project surface rendering background and shadow
- 多睡觉,能减肥,芝加哥大学最新研究:每天多睡1小时,等于少吃一根炸鸡腿...
- Apache+php uploading large files
猜你喜欢

Code scanning payment flow chart of Alipay payment function developed by PHP

台式电脑连不上wifi怎么办

基于SSH实现的学生成绩管理系统

Heavy broadcast | phase shift method + mathematical principle derivation of multi frequency heterodyne + implementation

buuctf web

绝了!自动点赞,我用 PyAutoGUI!

哪个编程语言实现hello world最烦琐?

WPF 使用 MAUI 的自绘制逻辑

以太网是什么要怎么连接电脑

At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
随机推荐
Mysql interactive_ Timeout and wait_ Timeout differences
Swift rapid development
How micro engine uploads remote attachments
Which programming language is the most cumbersome to implement Hello world?
Kotlin compose perfect todo project surface rendering background and shadow
How PHP gets the user's City
Precise delay based on Cortex-M3 and M4 (systick delay of system timer can be used for STM32, aducm4050, etc.)
Summary of SQL injection (I)
OOP vector addition and subtraction (friend + copy construction)
[Flink] problems and solutions of the continuous growth of checkpoint size in rocksdb incremental mode
"Daily practice, happy water" 1108 IP address invalidation
[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]
JS call() and apply()
leetcode1221. Split balance string
Response (XI)
Efficient NoSQL database service Amazon dynamodb experience sharing
ORA-00800: soft external error
Kotlin Compose 完善toDo项目 Surface 渲染背景 与阴影
At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
Calculate student grade (virtual function and polymorphism)