当前位置:网站首页>Soft test - database (2) relational model
Soft test - database (2) relational model
2022-07-28 02:19:00 【Caterpillars who want to write programs】
1.1 relational model
1.1.1 Definition
From the user's point of view , The logical structure of data in a relational model is a two-dimensional table , It consists of rows and columns ;
Express entity set with table structure , Use foreign keys ( Outer code ) Indicates the entity simple connection ;
1.1.2 Advantages and disadvantages
advantage :
Based on strict mathematical concepts ;
A single concept , Simple structure 、 Clear 、 It's easy for users to understand and use ;
Access path is transparent to users , So data independence 、 Good safety , Simplify database development ;
shortcoming :
Because the access path is transparent , Query efficiency is often lower than that of non relational data model ;
1.2 Basic concepts
1.2.1 Domain
Is a set of values with the same data type ;
1.2.2 The cartesian product
Two sets X and Y The Cartesian product of , Also called direct product , Expressed as X * Y , The first object is X And the second object is Y One of the members of all possible ordered pairs .
example :X = { a ,b ,c },Y = { 1 , 2 , 3 }
X * Y = {
< a ,1 >,< a ,2 >,< a ,3 >,
< b ,1 >,< b ,2 >,< b ,3 >,
< c ,1 >,< c ,2 >,< c ,3 >,
}
1.2.3 The expression of relationship
Express :
D1 * D2 * …… * Dn A subset of is called in the domain D1,D2,……,Dn Relationship on , Expressed as
R( D1,D2,……,Dn )
R: Relationship name ;
n: The purpose or degree of a relationship ;
Relationships are also a two-dimensional table , Each row of the table corresponds to a tuple , Each column of the table corresponds to a field ;
attribute :
Different columns in a relationship can correspond to the same domain
To make a difference , You have to give each column a name , Called attribute ;
n There must be a relationship between eyes n Attributes ;
Candidate code :
If the value of an attribute group in a relationship can uniquely identify a tuple , The attribute group is called candidate code ;
Main code :
If a relation has more than one candidate code , Select one of the main codes ;

1.2.4 The nature of the basic relationship
The basic relationship has the following 6 Article nature :
1. Columns are homogeneous , That is, the components in each column are the same type of data , From the same domain ;
2. Different columns can come from the same field , Call each of these columns an attribute , Different attributes should be given different attribute names ;
3. The order of the columns doesn't matter , That is, the order of columns can be exchanged arbitrarily ;
4. Any two tuples cannot be exactly the same ;( But in most practical relational database products , for example Oracle , If the user does not define relevant constraints , They both allow two identical tuples in the relational table )
5. The order of the lines doesn't matter , That is, the order of lines can be exchanged arbitrarily ;
6. The component must be atomic , That is, each component must be an indivisible data item ;
1.3 normal form
1.3.1 First normal form
If the relationship pattern R Every relationship r Are inseparable atomic values , So called R It is the mode of the first paradigm ,r Is a normalized relationship ;
In any relational database , The first paradigm is the basic requirement of relational model , Not satisfied with the first paradigm ( 1NF ) Is not a relational database ;
1.3.2 Second normal form
If the relational pattern R yes 1NF, And each non primary attribute is completely functionally dependent on candidate keys , So called R yes 2NF Pattern ;
1.3.3 Third normal form
If the relationship pattern R yes 1NF , And each non primary attribute does not pass dependent on R The candidate code for , said R yes 3NF ;
1.3.4 BC normal form
If the relational pattern R yes 1NF , And each attribute is not passed since R Candidate key for , So called R yes BCNF Pattern ;
边栏推荐
- 【ROS进阶篇】第九讲 基于Rviz和Arbotix控制的机器人模型运动
- 小程序毕设作品之微信校园浴室预约小程序毕业设计成品(1)开发概要
- mongodb/mongoTemplate.upsert批量插入更新数据的实现
- 【网站搭建】使用acme.sh更新ssl证书:将zerossl改为letsencrypt
- Use of classes in typescript
- Promise从入门到精通 (第2章 Promise的理解和使用)
- QGIS mapping: vector data mapping process and export
- Likeshop takeout ordering system [100% open source, no encryption]
- Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)
- Flume(5个demo轻松入门)
猜你喜欢

C# 使用Abp仓储访问数据库时报错记录集

Plato Farm在Elephant Swap上铸造的ePLATO是什么?

探究flex-basis

软考 --- 数据库(2)关系模型

54: Chapter 5: develop admin management services: 7: face warehousing process; Face login process; The browser turns on the video debugging mode (so that the camera can also be turned on in the case o

Fluorite network, difficult to be a "lone brave"

Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始

小米网站主页面大模块——小模块+导航(浮动案例)

Leetcode hot topic Hot 100 - > 1. Sum of two numbers

Skywalking distributed system application performance monitoring tool - medium
随机推荐
Xiaomi website homepage big module - small module + navigation (floating case)
Huawei app UI automation test post interview real questions, real interview experience.
11 Django basics database operation
Software testing interview question: what types of software testing are you familiar with?
组原必备知识点
C # using ABP warehouse to access the database error record set
C#引入WINAPI传递中文字符串参数字符集问题
C# 使用Abp仓储访问数据库时报错记录集
Product interpretation - Design and distributed expansion of metersphere UI test module
Unity 保存图片到相册以及权限管理
Software test interview question: please introduce the meaning of various test types in detail?
QGIS mapping: vector data mapping process and export
Vxe table/grid cell grouping and merging
Skywalking distributed system application performance monitoring tool - medium
uniapp 总结篇 (小程序)
Shell regular and metacharacters
Software test interview questions: common post data submission methods
Two ways for wechat applet to realize dynamic horizontal step bar
一种比读写锁更快的锁,还不赶紧认识一下
Implementation of mongodb/mongotemplate.upsert batch inserting update data