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

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

更新时间:2024-04-24 05:15:10
收藏
纠错
正确答案:

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

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

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

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

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

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

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

答案解析:

暂无解析

你可能感兴趣的试题

要消除查询结果集中的重复值,可在SELECT语句中使用关键字______。

在安装和配置MySQL实例的向导中,可选的MySQL服务器类型包括______。

MySQL中,下列关于授权的描述中,正确的是______。

如何创建表、修改表、删除表?

在使用INSERT语句插入数据时,正确的使用形式不包括______。

热门试题 更多>
试题分类: 软件测试工程师
试题分类: MySQL数据库程序设计
试题分类: 水利
试题分类: Web程序设计
Thefoodweeatseemstohaveprofoundeffectsonourhealth.Althoughsciencehasmadeenormousstepsinmakingfoodmorefittoeat,ithas,atthesametime,mademanyfoodsunfittoeat.Someresearchhasshownthatperhapseightypercentofcancerisrelatedtothedietaswell,especiallycancerthecolon.Differentculturesaremorepronetocontractcertainillnessesbecauseofthefoodthatischaracteristicinthesecultures.Thatfoodrelatedtollnessisnotanewdiscovery.In1945,governmentresearchersrealizedthatitratesandnitrites,commonlyusedtopreservecolorinmeats,andotherfooddditives,causedcancer.Yet,thesecarcinogenicadditivesremaininourfood,nditbecomesmoredifficultallthetimetoknowwhichthingsonthepackginglabelsofprocessedfoodarehelpfulorharmful.Theadditiveswhichweeatarenotallsodirect.Farmersoftengivepenicillintobeefandpoultry,andbecauseofthis,penicillinhasbeenfoundinthemilkoftreatedcows.Sometimessimilardrugsareadministeredtoanimalsnotformedicinalpurposes,butforfinancialreasons.Thefarmersaresimplytryingtofattentheanimalsinordertoobtainahigherpriceonthemarket.AlthoughtheFoodandDrugAdministration(FDA)hastriedrepeatedlytocontroltheseprocedures,thepracticescontinue. 48.Whatisthemaintopicofthepassage? A.Foodandourhealth BFoodandadditives C.Foodandcancer DFoodandculture 49AllofthefollowingstatementsaretrueEXCEPT_______. AFortypercentofcanceriscausedbyproblemsrelatedtofood. BResearchershaveknownaboutthepotentialdangeroffoodadditivesformanyyears C.Weeatsomeofthefoodadditivesdirectlyandsomeindirectly DDrugsarealwaysgiventoanimalsformedicinalpurposes 50.Whydofarmersgivedrugstotheiranimals? A.tospeedupthegrowthofanimals BTomaketheanimalsfatter Ctomaketheanimals’meatfittoeat DTomaketheanimals’meatrichinnutrients 51.Itcanbeinferredfromthepassagethat_________. Ascientisthavemadeallthefoodfittoeat Bonlyinrecentyearshavepeoplefoundthatthefoodisrelatedtoone’sillness Callkindsofcancerarerelatedtothediet Dsomeadditivesareharmfultoourhealth 52.Theword“this”inthesecondsentenceofparagraph2mostprobablyrefersto__________. Afarmer Bpenicillin Cbeefandpoultry Dthefactthatfarmersoftengivepenicillintoabeef
试题分类: 英语B级