当前位置:网站首页>(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
边栏推荐
- BBS forum recommendation
- Tencent interview: can you pour water?
- Global and Chinese market of melting furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
- Shell script three swordsman sed
- Fudan 961 review
- Vscode regular match replace console log(.*)
- 2022 system integration project management engineer examination knowledge points: software development model
- AI Challenger 2018 text mining competition related solutions and code summary
- MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
猜你喜欢
It is forbidden to splice SQL in code
2022 free examination questions for hoisting machinery command and hoisting machinery command theory examination
2022 system integration project management engineer examination knowledge points: software development model
Introducing Software Testing
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
Correlation analysis summary
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
(Video + graphics and text) introduction to machine learning series - Chapter 4 naive Bayes
How to prevent malicious crawling of information by one-to-one live broadcast source server
Enter MySQL in docker container by command under Linux
随机推荐
2022 system integration project management engineer examination knowledge points: software development model
MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
Gossip about redis source code 81
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
P1629 postman delivering letter
It is forbidden to splice SQL in code
Gossip about redis source code 73
[MySQL] sql99 syntax to realize multi table query
Alibaba cloud container service differentiation SLO hybrid technology practice
Test the influence of influent swacth on the electromagnetic coil of quartz meter
Reading notes on how programs run
Joint examination of six provinces 2017
Comment obtenir une commission préférentielle pour l'ouverture d'un compte en bourse? Est - ce que l'ouverture d'un compte en ligne est sécurisée?
I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
NLP pre training technology development
Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
How to make recv have a little temper?
Selenium library 4.5.0 keyword explanation (I)
Recommendation of knowledge base management system
Gossip about redis source code 77