当前位置:考试网  > 试卷库  > 计算机类  > 等级考试  > 计算机二级  > MySQL数据库程序设计  > 常见的几种约束有哪些?分别代表什么意思?如何使用?
试题预览

常见的几种约束有哪些?分别代表什么意思?如何使用?

查看答案
收藏
纠错
正确答案:

主键约束,外键约束,检查约束,唯一约束,默认约束

约束:在 Create table 或 alter table 时加约束

(1) 主键: PRIMARY KEY ( 主键字段 ) 保证了实体完整性,一个表只有一个主键,但一个主键可有包含多个字段,主键字段不能为空

(2) 唯一: UNIQUE (约束字段 ) 保证了实体完整性,一个表只有多个唯一约束,一个唯一约束可有包含多个字段

(3) 外键:FOREIGN KEY (外键字段 ) REFERENCES 主键表 (主键字段 ) 保证了引用完整性,一个表可以有多个外键

(4) 检查: CHECK(检查表达式 ) 保证了域完整性, 一个表中可以有多个检查性约束

(5) 默认值: DEFAULT (默认值的表达式或 NULL) for 字段名 保证了域完整性 , 一个表可以有多个默认值约束,但是一个字段只有一个默认值

答案解析:

暂无解析

你可能感兴趣的试题

有接头的钢丝绳,可用于立井中专为升降物料的绞车。

尾矿库使用到设计最终坝高的三分之一时,应对尾矿堆积坝进行工程地质勘察和稳定性分析。

煤层顶板是指位于煤层上面的岩层。

矿井安全监控系统的监测日报表必须报矿长和技术负责人审阅。

国发[2010]23号文中要求凡在规定时间内未实现安全标准化达标的企业,要依法暂扣其生产许可证、安全生产许可证,责令停产整顿。

热门试题 更多>
试题分类: 施工员
练习次数:0次
Part III Cloze Directions: There are twenty blanks in the following passage. For each blank there are four choices. Choose the one that best fits into the passage and then marks your answer on the Answer Sheet. There are two factors which determine an individual’s intelligence. The first is the sort of brain he is born 61 . Human brains differ considerably, 62 being more capable than others. 63 no matter how good a brain he has to begin with, an individual will have a low order of intelligence 64 he has opportunities to learn. So the second factor is what 65 to the individual—the sort of environment in which he is brought 66 . If an individual is handicapped (受阻碍) 67 , it is likely that his brain will 68 to develop and he will 69 attain the level of intelligence of which he is 70 . The importance of environment in determining an individual’s intelligence can be 71 by the case history of the identical twins, Peter and John. When the twins were three months old, their parents died, and they are placed in 72 foster (寄养) homes. Peter was reared by parents of low intelligence in an 73 community with poor educational 74 . John, 75 , was educated in the home of well-to-do parents who has been to college. This environmental 76 continued until the twins were 77 their late teens, 78 they were given tests to 79 their intelligence. John’s I.Q. (智商) was 125, twenty-five points higher than the 80 and fully forty points higher than his identical brother. 61. A. for B. by C. with D. in 62. A. most B. some C. many D. few 63. A. But B. For C. Still D. And 64. A. if B. thought C. as D. unless 65. A. refers B. applies C. happens D. concerns 66. A. about B. up C. forward D. forth 67. A. relatively B. intelligently C. regularly D. environmentally 68. A. fail B. help C. manage D. stop 69. A. ever B. never C. even D. nearly 70. A. able B. capable C. available D. acceptable 71. A. demonstrated B. denied C. neglected D. ignored 72. A. separate B. similar C. remote D. individual 73. A. omitted B. isolated C. enclosed D. occupied 74. A. possibilities B. opportunities C. capacities D. responsibilities 75. A. moreover B. consequently C. then D. however 76. A. exception B. division C. difference D. alteration 77. A. in B. by C. at C. for 78. A. while B. since C. when D. because 79. A. estimate B. count C. decide D. measure 80. A. average B. common C. usual D. ordinary
试题分类: 大学英语六级
练习次数:0次
试题分类: 施工员
练习次数:2次
If the old maxim that the customer is always right still has meaning, then the airlines that ply the world’s busiest air route between London and Paris have a flight on their hands. The Eurostar train service linking the UK and French capitals via the Channel Tunnel is winning customers in increasing numbers. In late May, it carried its one millionth passenger, having run only a limited service between London, Paris and Brussels since November 1994, starting with two trains a day in each direction to Paris and Brussels. By 1997, the company believes that it will be carrying ten million passengers a year, and continue to grow from there. From July, Eurostar steps its service to nine trains each way between London and Paris, and five between London and Brussels. Each train carries almost 800 passengers, 210 of them in first class. The airlines estimate that they will initially lose around 15%-20% of their London-Paris traffic to the railways once Eurostar starts a full service later this year (1995), with 15 trains a day each way. A similar service will start to Brussels. The damage will be limited, however, the airlines believe, with passenger numbers returning to previous levels within two to three years. In the short term, the damage caused by the 1 million people-levels traveling between London and Paris and Brussels on Eurostar trains means that some air services are already suffering. Some of the major carriers say that their passenger numbers are down by less than 5% and point to their rivals-Particularly Air France-as having suffered the problems. On the Brussels route, the railway company had less success, and the airlines report anything from around a 5% drop to no visible decline in traffic. The airlines’ optimism on returning traffic levels is based on historical precedent. British Midland, for example, points to its experience on Heathrow Leeds Bradford service which saw passenger numbers fold by 15% when British Rail electrified and modernized the railway line between London and Yorkshire. Two years later, travel had risen between the two destinations to the point where the airline was carrying record numbers of passengers. 1.British airlines confide in the fact that__. A.they are more powerful than other European airlines. B.their total loss won’t go beyond a drop of 5% passengers. C.their traffic levels will return in 2-3 years. D.traveling by rail can never catch up with traveling by air. 2.The author’s attitude towards the drop of passengers may be described as__. A.worried.B.delightedC.puzzled.D.unrivaled. 3.In the passage, British Rail (Para 6) is mentioned to__. A.provide a comparison with Eurostar. B.support the airlines’ optimism. C.prove the inevitable drop of air passengers. D.call for electrification and modernization of the railway. 4.The railway’s Brussels route is brought forth to show that__. A.the Eurostar train service is not doing good business. B.the airlines can well compete with the railway. C.the Eurostar train service only caused little damage. D.only some airlines, such as Air France, are suffering. 5.The passage is taken from the first of an essay, from which we may well predict that in the following part the author is going to__. A.praise the airlines’ clear-mindedness. B.warn the airlines of high-speed rail services. C.propose a reduction of London/Paris flights. D.advise the airlines to follow British Midland as their model.
试题分类: 大学英语六级
练习次数:8次
Let children learn to judge their own work. A child learning to talk does not learn by being corrected all the time; if corrected too much, he will stop talking. He notices a thousand times a day the difference between the languages he uses and the language those around him use. Bit by bit, he makes the necessary changes to make his language like other people. In the same way, when children learn to do all the other things they learn to do without being taught-to walk, run, climb, whistle, ride a bicycle-compare those performances with those of more skilled people, and slowly make the needed changes. But in school we never give a child a chance to find out his own mistakes for himself, let alone correct them. We do it all for him. We act as if we thought that he would never notice a mistake unless it was pointed out to him, or correct it unless he was made to. Soon he becomes dependent on the teacher. Let him do it himself. Let him work out, with the help of other children if he wants it, what this word says, what answer is to that problem, whether this is a good way of saying or doing this or not. If it is a matter of right answers, as it may be in mathematics or science, give him the answer book. Let him correct his own papers. Why should we teachers waste time on such routine work? Our job should be to help the child when he tells us that he can’t find the way to get the right answer. Let’s end this nonsense of grades, exams, marks, Let us throw them all out, and let the children learn what all educated persons must some day learn, how to measure their own understanding, how to know what they know or do not know. Let them get on with this job in the way that seems sensible to them. With our help as school teachers if they ask for it. The idea that there is a body of knowledge to be learnt at school and used for the rest of one’s life is nonsense in a world as complicated and rapidly changing as ours. Anxious parents and teachers say, “But suppose they fail to learn something essential they will need to get in the world?” Don’t worry! If it is essential, they will go out into the world and learn it. 1.What does the author think is the best way for children to learn things? A.by copying what other people do. B.by making mistakes and having them corrected. C.by listening to explanations from skilled people. D.by asking a great many questions. 2.What does the author think teachers do which they should not do? A.They give children correct answers. B.They point out children’s mistakes to them. C.They allow children to mark their own work. D.They encourage children to mark to copy from one another. 3.The passage suggests that learning to speak and learning to ride a bicycle are___. A.not really important skills. B.more important than other skills. C.basically different from learning adult skills. D.basically the same as learning other skills. 4.Exams, grades, and marks should be abolished because children’s progress should only be estimated by___. A.educated persons. B.the children themselves. C.teachers. D.parents. 5.The author fears that children will grow up into adults while being___. A.too independent of others. B.too critical of themselves. C.incapable to think for themselves. D.incapable to use basic skills.
试题分类: 大学英语六级
练习次数:3次
扫一扫,手机做题