单选题You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()A ALTER TABLE students ADD PRIMARY KEY _ id;B ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (s

题目
单选题
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
A

ALTER TABLE students ADD PRIMARY KEY _ id;

B

ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

C

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

D

ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

E

ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


相似考题
更多“You need to modify the STUDENTS table to add a primary key o”相关问题
  • 第1题:

    Which statement explicitly names a constraint? ()

    A. ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);

    B. ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    C. ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    D. ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    E. ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);


    参考答案:C

  • 第2题:

    某数据库系统中,假设有部门关系 Dept (部门号,部门名,负责人,电话),其中, "部门号"是该关系的主键;员工关系 Emp (员工号,姓名,部门,家庭住址),属性"家 庭住址"包含省、市、街道以及门牌号,该属性是一个( )属性。 创建 Emp 关系的 SQL 语句如下: CREATE TABLE Emp( 员工号 CHAR(4) ( ), 姓名 CHAR(10), 部门 CHAR(4), 家庭住址 CHAR(30), ( ); 为在员工关系 Emp 中增加一个"工资"字段,其数据类型为数字型并保留2 位小数, 可采用的 SQL 语句为( )。

    A. 简单 B. 复合 C.多值 D. 派生A. PRIMARY KEY B. NULL C. FOREIGN KEY D. NOT NULLA.PRIMARY KEY NOT NULLB. PRIMARY KEY UNIQUEC. FOREIGN KEY REFERENCES Dept(部门名)D. FOREIGN KEY REFERENCES Dept(部门号)A.ALTER TABLE Emp ADD 工资 CHAR(6,2);B.UPDATA TABLE Emp ADD 工资 NUMERIC(6,2);C.ALTER TABLE Emp ADD 工资 NUMERIC (6,2);D.ALTER TABLE Emp MODIFY 工资 NUMERI C(6,2);


    正确答案:B,A,D,C

  • 第3题:

    为表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

  • 第4题:

    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named named Dworks in the instance. The Dworks table has a table named BillDetails which has a clustered primary key named BillId on the BillId column. The BillDetails table has a single XML column named GoodsDetails. The XML column has an XML index and XML data are stored in this XML column. A new column named GoodsID is added to the BillDetails table. GoodsID must be included in the primary key.  So what action should you perform to achieve this goal?()  

    • A、You should drop the XML index on the table. Modify the primary key. Recreate the XML index 
    • B、You should alter the XML index and set the ALLOW_ROW_LOCKS = OFF option. Alter the primary key and set the ALLOW_ROW_LOCKS = ON option. 
    • C、You should move the XML data to a temporary table. Clear the XML data from the original table by setting the GoodsDetails column to NULL. Modify the primary key. Repopulate the ProductSpecs column. 
    • D、You should disable the XML index on the GoodsDetails column. Modify the primary key.Enable the XML index on the ProductSpecs column.

    正确答案:A

  • 第5题:

    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()

    • A、ALTER TABLE students ADD PRIMARY KEY student_id;
    • B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
    • C、ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
    • D、ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

    正确答案:C

  • 第6题:

    Examine the following statement that is used to modify the primary key constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements aretrue regarding the above command()

    • A、The constraint remains valid.
    • B、The index on the constraint is dropped.
    • C、It allows the loading of data into the table using SQL *Loader.
    • D、New data conforms to the constraint, but existing data is not checked.
    • E、It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.

    正确答案:A,B,C

  • 第7题:

    You have an enterprise subordinate certification authority (CA) configured for key archival. Three key  recovery agent certificates are issued.   The CA is configured to use two recovery agents.   You need to ensure that all of the recovery agent certificates can be used to recover all new private keys.   What should you do()

    • A、Add a data recovery agent to the Default Domain Policy.
    • B、Modify the value in the Number of recovery agents to use box.
    • C、Revoke the current key recovery agent certificates and issue three new key recovery agent certificates.
    • D、Assign the Issue and Manage Certificates permission to users who have the key recovery agent  certificates.

    正确答案:B

  • 第8题:

    单选题
    View the Exhibit and examine the structure of the EMP table. You executed the following command to add a primary key to the EMP table:   ALTER TABLE emp   ADD CONSTRAINT emp_id_pk  PRIMARY KEY (emp_id)   USING INDEX emp_id_idx;   Which statement is true regarding the effect of the command?()
    A

     The PRIMARY KEY is created along with a new index.

    B

     The PRIMARY KEY is created and it would use an existing unique index.

    C

     The PRIMARY KEY would be created in a disabled state because it is using an existing index.

    D

     The statement produces an error because the USING clause is permitted only in the CREATE TABLE command.


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

  • 第9题:

    单选题
    You own a table called EMPLOYEES with this table structure: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE What happens when you execute this DELETE statement? DELETE employees; ()
    A

    You get an error because of a primary key violation.

    B

    The data and structure of the EMPLOYEES table are deleted.

    C

    The data in the EMPLOYEES table is deleted but not the structure.

    D

    You get an error because the statement is not syntactically correct.


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

  • 第10题:

    单选题
    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
    A

    ALTER TABLE students ADD PRIMARY KEY _ id;

    B

    ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

    C

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

    D

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

    E

    ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


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

  • 第11题:

    多选题
    User SCOTT wants to back out the transactions on the REGIONS table in his schema. As a DBA, which commands must you execute to enable SCOTT to flash back the transactions?()
    A

    ALTER DATABASE FLASHBACK ON

    B

    GRANT SELECT any transaction TO scott

    C

    GRANT EXECUTE ON dbms_flashback TO scott

    D

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA

    E

    ALTER TABLESPACE undots1 RETENTION GUARANTEE

    F

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS


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

  • 第12题:

    单选题
    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
    A

    ALTER TABLE students ADD PRIMARY KEY student_id;

    B

    ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

    C

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

    D

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

    E

    ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


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

  • 第13题:

    Examine the data in the EMPLOYEES table.On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column.Evaluate this DELETE statement:Why does the DELETE statement fail when you execute it?()

    A. There is no row with dept_id 90 in the EMPLOYEES table.

    B. You cannot delete the JOB_ID column because it is a NOT NULL column.

    C. You cannot specify column names in the DELETE clause of the DELETE statement.

    D. You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.


    参考答案:C

  • 第14题:

    Click the Exhibit button and examine the data in the EMPLOYEES table.On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column.Evaluate this DELETE statement:DELETE employee_id, salary, job_idFROM employeesWHERE dept_id = 90;Why does the DELETE statement fail when you execute it?()

    A.There is no row with dept_id 90 in the EMPLOYEES table.

    B.You cannot delete the JOB_ID column because it is a NOT NULL column.

    C.You cannot specify column names in the DELETE clause of the DELETE statement.

    D.You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.


    参考答案:C

  • 第15题:

    You need to meet the business requirements of the packaging department. What should you do?()

    • A、Add the ProductSize data table and the ProductSizeDescriptor column to the Product dimension. Set the order of the ProductSKU attribute to the ProductSizeDescriptor column.
    • B、Add the ProductSize data table as a dimension and then add this dimension to the cube as a Referenced dimension. Set the order of the key attribute of the ProductSize dimension to the ProductSizeDescriptor column.
    • C、Add the ProductSize data table and the ProductSizeDescriptor column to the Product dimension. Create a user-defined hierarchy that has ProductSKU as the top-level attribute and ProductSizeDescriptor as the bottom-level attribute.
    • D、Add the ProductSize data table as a dimension and then add this dimension to the cube as a Referenced dimension. Create a user-defined hierarchy within the ProductSize dimension. Set the ProductSizeDescriptor attribute as the top-level attribute.

    正确答案:A

  • 第16题:

    Which two statements are true about the primary key constraint in a table? ()

    • A、It is not possible to disable the primary key constraint.
    • B、It is possible to have more than one primary key constraint in a single table.
    • C、The primary key constraint can be referred by only one foreign key constraint.
    • D、The primary key constraint can be imposed by combining more than one column.
    • E、The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.

    正确答案:D,E

  • 第17题:

    You plan to move data from a flat file to a table in your database. You decide to use SQL*Loader direct pathload method to perform this task. The table in which you plan to load data is an important table having variousintegrity constraints defined on it.  Which constraints will remain enabled by default during this operation()

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

    正确答案:B,C,D

  • 第18题:

    You have an Exchange Server 2010 organization.You create a distribution group for all users in your company.You need to ensure that new users can add their mailboxes to the distribution group.What should you do?()

    • A、Modify the group scope of the distribution group.
    • B、Modify the approval mode of the distribution group.
    • C、Modify the security settings of the distribution group.
    • D、Modify the authentication settings of the ECP virtual directory.

    正确答案:B

  • 第19题:

    You have a computer that runs Windows 7. You create an Encrypting File System (EFS) recovery key andcertificate. You need to ensure that your user account can decrypt all EFS files on the  computer.  Whatshould you do?( )

    • A、From Credential Manager, add a Windows credential.
    • B、From Credential Manager, add a certificate-based credential.
    • C、From the local computer policy, add a data recovery agent.
    • D、From the local computer policy, modify the Restore files and directories setting.

    正确答案:C

  • 第20题:

    单选题
    You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named named Dworks in the instance. The Dworks table has a table named BillDetails which has a clustered primary key named BillId on the BillId column. The BillDetails table has a single XML column named GoodsDetails. The XML column has an XML index and XML data are stored in this XML column. A new column named GoodsID is added to the BillDetails table. GoodsID must be included in the primary key.  So what action should you perform to achieve this goal?()
    A

    You should drop the XML index on the table. Modify the primary key. Recreate the XML index 

    B

    You should alter the XML index and set the ALLOW_ROW_LOCKS = OFF option. Alter the primary key and set the ALLOW_ROW_LOCKS = ON option. 

    C

    You should move the XML data to a temporary table. Clear the XML data from the original table by setting the GoodsDetails column to NULL. Modify the primary key. Repopulate the ProductSpecs column. 

    D

    You should disable the XML index on the GoodsDetails column. Modify the primary key.Enable the XML index on the ProductSpecs column.


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

  • 第21题:

    单选题
    Which statement explicitly names a constraint?()
    A

    ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);

    B

    ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    C

    ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    D

    ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

    E

    ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);


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

  • 第22题:

    多选题
    Which two statements are true about the primary key constraint in a table? ()
    A

    It is not possible to disable the primary key constraint.

    B

    It is possible to have more than one primary key constraint in a single table.

    C

    The primary key constraint can be referred by only one foreign key constraint.

    D

    The primary key constraint can be imposed by combining more than one column.

    E

    The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.


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

  • 第23题:

    单选题
    You need to design a student registration database that contains several tables storing academic information. The STUDENTS table stores information about a student. The STUDENT_GRADES table stores information about the student's grades. Both of the tables have a column named STUDENT_ID. The STUDENT_ID column in the STUDENTS table is a primary key. You need to create a foreign key on the STUDENT_ID column of the STUDENT_GRADES table that points to the STUDENT_ID column of the STUDENTS table. Which statement creates the foreign key?()
    A

    CREATE TABLE student_grades (student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT student_id_fk REFERENCES (student_id) FOREIGN KEY student (student_id));

    B

    CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id));

    C

    CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT FOREIGN KEY (student_id) REFERENCES student (student_id));

    D

    CREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id));


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

  • 第24题:

    单选题
    要向雇员表中的部门标识列添加FOREIGNKEY约束条件以引用部门表中的标识列,应该使用哪个语句()
    A

    ALTER TABLE雇员MODIFY COLUMN dept_id_fk FOREIGN KEY(部门标识)REFERENCES部门(部门标识)

    B

    ALTER TABLE雇员ADD CONSTRAINT dept_id_fk FOREIGNKEY(部门标识)REFERENCES部门(部门标识)

    C

    ALTER TABLE雇员ADD FOREIGN KEY CONSTRAINT dept_id_fk ON(部门标识)REFERENCES部门(部门标识)

    D

    ALTER TABLE雇员ADD FOREIGN KEY 部门(部门标识)REFERENCES(部门标识)


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