niusouti.com
更多“SQL Server 自动为primary key约束的列建立一”相关问题
  • 第1题:

    SQL语言中实现候选码约束的语句是(24)。

    A.用Candidate Key指定

    B.用Primary Key指定

    C.用UNIQUE NOT NULL约束指定

    D.用UNIQUE约束指定


    正确答案:C
    解析:标准SQL定义了主码、外码约束,并没有直接定义候选码,候选码取值不能为空和不取重复值的约束可以通过UNIQUENOTNULL来实现。

  • 第2题:

    通常情况,SQL Server 2005主要支持PRIMARY约束、UNIQUE约束、CHECK约束、DEFAULT约束、FOREIGN约束。( )在定义列时,它可以为表中的指定列提供默认值。

    A.FOREIGN约束

    B.DEFAULT约束

    C.UNIQUE约束

    D.CHECK


    正确答案:B


  • 第3题:

    在SQL Server 2000语句命令中,指定该列为该表的唯一标识行列的选项是()。

    • A、DEFAULT
    • B、IDENTITY
    • C、ROWGUIDCOL
    • D、PRIMARY KEY

    正确答案:C

  • 第4题:

    为表TEST中ID列添加主键约束的语法是()

    • A、ALTER  TABLE  TEST  CHANGE( ID  INT  PRIMARY  KEY)
    • B、ALTER  TABLE  TEST  ADD( ID  INT  PRIMARY  KEY)
    • C、ALTER  TABLE  TEST  MODIFY( ID  INT  PRIMARY  KEY)
    • D、ALTER  TABLE  TEST  ADD  CONSTRAINT PK  PRIMARY KEY (ID)

    正确答案:D

  • 第5题:

    以下关于索引的哪个说法是对的()

    • A、创建PRIMARY KEY约束条件时,会自动创建一个索引
    • B、创建PRIMARY KEY约束条件时,必须由数据库管理员创建索引
    • C、从不为唯一约束条件创建索引
    • D、创建PRIMARY KEY约束条件以前,不能创建索引

    正确答案:A

  • 第6题:

    使用SQL语言创建一个表,要限定某列的值具有唯一性,可以使用()约束。

    • A、PRIMARY KEY
    • B、CHECK
    • C、UNIQUE
    • D、FOREIGN KEY

    正确答案:A,C

  • 第7题:

    FOREIGN KEY约束能够自动建立索引。


    正确答案:错误

  • 第8题:

    通过逻辑表达式判断限制插入到列中的值,这属于哪种约束()

    • A、DEFAULT约束
    • B、CHECK约束
    • C、PRIMARY KEY约束
    • D、FOREIGN KEY约束

    正确答案:B

  • 第9题:

    当向数据库表中插入数据时,如果没有明确地提供输入值时,SQL Server自动为该列输入指定值,这属于哪种约束()

    • A、DEFAULT约束
    • B、CHECK约束
    • C、PRIMARY KEY约束
    • D、FOREIGN KEY约束

    正确答案:A

  • 第10题:

    判断题
    SQL Server 自动为primary key约束的列建立一个索引。
    A

    B


    正确答案:
    解析: 暂无解析

  • 第11题:

    单选题
    通常情况,SQL Server 2005主要支持PRIMARY约束、UNIQUE约束、CHECK约束、DEFAULT约束、FOREIGN约束。()在定义列时,它可以为表中的指定列提供默认值。
    A

    FOREIGN约束

    B

    DEFAULT约束

    C

    UNIQUE约束

    D

    CHECK


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    当向数据库表中插入数据时,如果没有明确地提供输入值时,SQL Server自动为该列输入指定值,这属于哪种约束()
    A

    DEFAULT约束

    B

    CHECK约束

    C

    PRIMARY KEY约束

    D

    FOREIGN KEY约束


    正确答案: B
    解析: 暂无解析

  • 第13题:

    You are the administrator of SQL server 2000 computer. The server contains a database named MedicalRecords. Users access medical records by using the PatientID field. This field is the clustered primary key for the Patients table. When users try to access medical records, the database responds slowly. You examine the database options as shown in the exhibit.

    You want to accelerate query response time and minimize administrative overhead. How should you reconfigure the database?

    A.Create a SQL Server Agent job to execute the UPDATE STATISTICS statement, and schedule the job to run weekly.

    B.Select the Auto Update Statistics check box.

    C.Run the database maintenance plan wizard, and accept the default settings.

    D.Rebuild the primary key as a nonclustered primary key.

    E.Clear the Auto Create Statistics check box.


    正确答案:B
    解析:Explanation:TheAutoUpdateStatisticsoptionisselectedbydefaultbutintheExhibitithasbeendisabled.Apparentlythestatisticsareout-of-dateandthequeriesarerunningslowly.TheAutoUpdateStatisticsoptionshouldbeenabledtoincreaseperformanceandminimizeadministrativeoverhead.Note:SQLServerkeepsstatisticsaboutthedistributionofthekeyvaluesineachindexandusesthesestatisticstodeterminewhichindexwouldbethebestindextouseforaparticularqueryprocess.Asthedatainacolumnchanges,indexandcolumnstatisticscanbecomeout-of-date.Thiscanhinderthequeryoptimizer’sabilitytomakeoptimaldecisionsonhowtoprocessaquery.Asaresultqueryperformancewilldeteriorate.Whenstatisticsbecomeout-of-datetheycanbeupdatedautomaticallyiftheAutoUpdateStatisticscheckboxonthetablepropertydialogboxischecked.IncorrectAnswers:A:Itwouldrequiresomeadministrativeefforttosetupjobthatupdatethestatistics.JustselectingtheAutoUpdateStatisticscheckisabettersolution.C:TheDatabaseMaintenancePlanWizardcannotbeusedtorecreatethestatistics,whicharethemainproblematthemoment.Note:TheDatabaseMaintenancePlanWizardcanbeusedtosetupthecoremaintenancetasksnecessarytoensurethatadatabaseperformswell,isregularlybackedup,andischeckedforinconsistencies.TheDatabaseMaintenancePlanWizardcreatesaSQLServer2000jobthatperformsthesemaintenancetasksautomaticallyatscheduledintervalsandcanbeusedtoreorganizethedataonthedataandindexpagesbyrebuildingindexeswithanewfillfactor;compressdatafilesbyremovingemptydatabasepages;updateindexstatisticstoensurethequeryoptimizerhasup-todateinformationaboutthedistributionofdatavaluesinthetables;perform.internalconsistencychecksofthedataanddatapageswithinthedatabasetoensurethatasystemorsoftwareproblemhasnotdamageddata;backupthedatabaseandtransactionlogfiles;andtosetuplogshipping.D:Lookingattheexhibitweseethatthisisastatisticsproblem,notaindexproblem.Note:Anonclusteredindexissimilartoanindexinatextbook.Withthistypeofindex,thedataisstoredinoneplaceandtheindexinanother.Theseindexes,however,pointtothestoragelocationofthedata.Nonclusteredindexesshouldbeusedoncolumnsthatcontainalargenumberofdistinctvalues;forqueriesthatdonotreturnlargeresultsets;andforcolumnsthatarefrequentlyinvolvedinsearchconditionsofaquerythatreturnexactmatches.Aclusteredindex,ontheotherhand,determinesthephysicalorderofdatainatable.ThePRIMARYKEYindexautomaticallycreatesaclusteredindexasitisusedtoidentifyarowunlessanonclusteredindexisspecified.E:WhensettheAutoCreateStatisticscheckboxischecked,statisticsareautomaticallycreatedoncolumnsthatareusedinapredicate.AddingstatisticsimprovesqueryperformancebecausetheSQLServerqueryoptimizercanbetterdeterminehowtoevaluateaquery.Ifthestatisticsarenotused,SQLServerautomaticallydeletesthem.Whenthischeckboxiscleared,statisticsarenotautomaticallycreated.

  • 第14题:

    利用SQL语句的定义功能,建立一个“班级”表文件,其中为“ 班级号” 建立主索引,

    “班级名”的默认值为“计算机”,语句格式为:

    CREATE TABLE学生(;

    学号C(5)PRIMARY KEY;

    班级名C(16)__________计算机”).


    正确答案:
    DEFAULT
    【解析】在Visual FoxPro中可以通过SQL的CREATE TABLE命令建立表。其中,通过DEFAULT短语可以为指定字段建立默认值。

  • 第15题:

    您需要确保“座位标识”列中的每个值唯一或为Null。应该对“座位标识”列定义哪个约束条件?()

    • A、CHECK
    • B、UNIQUE
    • C、NOT NULL
    • D、PRIMARY KEY

    正确答案:A

  • 第16题:

    SQL Server 自动为primary key约束的列建立一个索引。


    正确答案:正确

  • 第17题:

    下列关于完整性约束的叙述中,正确的是()。

    • A、一个表可以有多个PRIMARY KEY约束
    • B、在任何情况下PRIMARY KEY约束都可以被删除
    • C、一个表可以有多个UNIQUE约束
    • D、使用NULL/NOT NULL可以设定某列的值允许为空值或不允许为空值

    正确答案:C,D

  • 第18题:

    当向数据库表中插入数据时,如果没有明确地提供输入值时,系统自动为该列输入指定值,这属于哪种约束()

    • A、CHECK约束
    • B、FOREIGN KEY约束
    • C、PRIMARY KEY约束
    • D、DEFAULT约束

    正确答案:D

  • 第19题:

    在SQL Server中,通常不需要用户建立索引,而是通过使用()约束和()约束,由系统自动建立索引。


    正确答案:主码;唯一值

  • 第20题:

    被FOREIGN KEY参照的列在表中应该具有()

    • A、DEFAULT约束
    • B、CHECK约束
    • C、PRIMARY KEY约束
    • D、REIGN KEY约束

    正确答案:C

  • 第21题:

    SQL SERVER数据库中,UNIQUE约束与PRIMARY KEY约束之间的区别是()

    • A、UNIQUE约束要求数据库表中至少存在一行数据,因此必须在创建数据库表之后才能创建,而PRIMARY KEY约束无此限制
    • B、UNIQUE约束允许存在空值,而PRIMARY KEY约束不允许存在空值
    • C、创建UNIQUE约束之后,该数据行允许被更改,而PRIMARY KEY约束的数据行,不允许更改
    • D、UNIQUE约束列不能创建外键,而PRIMAR YKEY约束列可以创建外键引用

    正确答案:B

  • 第22题:

    填空题
    在SQL Server中,通常不需要用户建立索引,而是通过使用()约束和()约束,由系统自动建立索引。

    正确答案: 主码,唯一值
    解析: 暂无解析

  • 第23题:

    多选题
    下列关于完整性约束的叙述中,正确的是()。
    A

    一个表可以有多个PRIMARY KEY约束

    B

    在任何情况下PRIMARY KEY约束都可以被删除

    C

    一个表可以有多个UNIQUE约束

    D

    使用NULL/NOT NULL可以设定某列的值允许为空值或不允许为空值


    正确答案: C,D
    解析: 暂无解析

  • 第24题:

    单选题
    当向数据库表中插入数据时,如果没有明确地提供输入值时,系统自动为该列输入指定值,这属于哪种约束()
    A

    CHECK约束

    B

    FOREIGN KEY约束

    C

    PRIMARY KEY约束

    D

    DEFAULT约束


    正确答案: D
    解析: DEFAULT约束用于向列中插入默认值,如果没有规定其他的值,那么会将默认值添加到所有的新记录。