当前位置:网站首页>(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

边栏推荐
- Shell script three swordsman sed
- I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- JDBC Technology
- Similarities and differences of text similarity between Jaccard and cosine
- Iclr2022: how does AI recognize "things I haven't seen"?
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- 2022 examination of safety production management personnel of hazardous chemical production units and examination skills of safety production management personnel of hazardous chemical production unit
- Recommendation of knowledge base management system
- ISBN number
猜你喜欢
![[source code] VB6 chat robot](/img/89/46b67f627c8257eaddc70a247c9ba5.jpg)
[source code] VB6 chat robot

"Learning notes" recursive & recursive

Regular expressions and text processors for shell programming

Recommendation of knowledge base management system

Alibaba cloud container service differentiation SLO hybrid technology practice

Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?

The interviewer's biggest lie to deceive you, bypassing three years of less struggle

Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
![[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections](/img/c6/3dc7d01600f6713afdbb4cf3df5238.jpg)
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections

Qtcharts notes (V) scatter diagram qscatterseries
随机推荐
P1629 postman delivering letter
2022 t elevator repair registration examination and the latest analysis of T elevator repair
Suggestions for improving code quality
I wrote a chat software with timeout connect function
Social network analysis -social network analysis
Gossip about redis source code 75
Ramble 72 of redis source code
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
[CSDN Q & A] experience and suggestions
2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) simulated examination and Guangdong Provincial Safety Officer a certificate third batch (main person in charg
Development and application of fcitx functional plug-ins
Test the influence of influent swacth on the electromagnetic coil of quartz meter
After the Lunar New Year and a half
D28:maximum sum (maximum sum, translation)
2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
Minimum commission for stock account opening. Stock account opening is free. Is online account opening safe
What is the difference between NFT, SFT and dnft? How to build NFT platform applications?
P1339 [USACO09OCT]Heat Wave G
ITK learning notes (VII) the position of ITK rotation direction remains unchanged
Gossip about redis source code 78




