当前位置:网站首页>(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises
(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises
2022-07-04 00:09:00 【Happy Jianghu】
【 answer 】


Integrity constraints : It refers to the semantic constraints that the data in the database should meet . Generally, it can be divided into six categories :
- Static column level constraints
- Static tuple constraint
- Static relationship constraints
- Dynamic column level constraints
- Dynamic tuple constraint
- Dynamic relationship constraints
① Static column level constraint is a description of the value field of a column , It includes the following aspects :
Yes data type Constraints , Including the type of data 、 length 、 Company 、 Precision etc.
Yes data format Constraints
Yes Value range or value set Constraints
Yes Null value Constraints
Other constraints
② Static tuple constraint is to specify the constraint relationship between the columns that make up a tuple , Static tuple constraints are limited to a single tuple
③ Static relation constraint is that there are various connections or constraints between the tuples of a relation or between several relations , Common static relationship constraints are
- Entity integrity constraints
- Refer to integrity constraints
- Functional dependency constraints
④ Dynamic column level constraints are the constraints that should be met when modifying column definitions or column values , Including the following two aspects :
- Constraints when modifying column definitions
- Constraints when modifying column values
⑤ Dynamic tuple constraint refers to the need to refer to its old value when modifying the value of a tuple , And some constraints need to be met between the old and new values
⑥ Dynamic relationship constraints are constraints placed on the state before and after the relationship changes , For example, transaction consistency 、 Constraints such as atomicity


【 answer 】
- Whether the outer code can be null
- The following updates need to be considered 、 Delete the question


CREATE TABLE Dept
(
Dept NUMBER(4) PRIMARY KEY,
Name VARCHAR(10),
Manager_name VARCHAR(10),
Phone NUMBER(11)
);
CREATE TABLE Worker
(
Nol NUMBER(4) PRIMARY KEY,
Name VARCHAR(10),
Age NUMBER(4) CHECK(W_age <= 60),
Job VARCHAR(10),
Wages NUMBER(7,2),
Deptno NUMBER(10),
FOREIGN KEY(W_deptno) REFERENCES Dept(Deptno)
);
【 answer 】
Entity integrity

Referential integrity

边栏推荐
- Distributed transaction -- middleware of TCC -- selection / comparison
- How to make icons easily
- D25:sequence search (sequence search, translation + problem solving)
- SPI based on firmware library
- P1656 bombing Railway
- Several ways to set up a blog locally [attach relevant software download links]
- JDBC Technology
- How to write a good title of 10w+?
- Gossip about redis source code 80
- 2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
猜你喜欢

Recommendation of knowledge base management system

Solve the problem that the kaggle account registration does not display the verification code

Is user authentication really simple

How to make recv have a little temper?
![Several ways to set up a blog locally [attach relevant software download links]](/img/2f/51a09d9ef71065319ed90306517854.jpg)
Several ways to set up a blog locally [attach relevant software download links]
![[source code] VB6 chat robot](/img/89/46b67f627c8257eaddc70a247c9ba5.jpg)
[source code] VB6 chat robot

BBS forum recommendation

Smart fan system based on stm32f407

Actual combat | use composite material 3 in application

Regular expressions and text processors for shell programming
随机推荐
A method to solve Bert long text matching
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
1214 print diamond
How to write a good title of 10w+?
It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something
Private project practice sharing populate joint query in mongoose makes the template unable to render - solve the error message: syntaxerror: unexpected token r in JSON at
Pytorch learning notes 5: model creation
2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
It is forbidden to splice SQL in code
Reading notes on how programs run
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
Gossip about redis source code 82
How to trade spot gold safely?
Suggestions for improving code quality
Powerful blog summary
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
Qtcharts notes (V) scatter diagram qscatterseries
2/14 (regular expression, sed streaming editor)
Generic tips
Axure resources and prototype tool Axure RP 9 download




