单选题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?()AALTER TABLE students ADD PRIMARY KEY student_id;BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);CALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);DALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

单选题
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);


参考解析

解析: 暂无解析

相关考题:

You are the database administrator for a retail company. The company owns 270 stores. Every month, each store submits approximately 2,000 sales records, which are loaded into a SQL Server 2000 database at the corporate headquarters.A Data Transformation Services (DTS) package transforms the sales records, as they are loaded. The package writes the transformed sales records to the Sales table, which has a column for integer primary key values. The IDENTITY property automatically assigns a key value to each transformed sales record.After loading this month's sales data, you discover that a portion of the data contains errors. You stop loading data, identify the problem records, and delete those records from the database.You want to reuse the key values that were assigned to the records that you deleted. You want to assign the deleted key values to the next sales records you load. You also want to disrupt users' work as little as possible.What should you do?A.Export all records from the Sales table to a temporary table. Truncate the Sales table, and then reload the records from the temporary table.B.Export all records from the Sales table to a text file. Drop the Sales table, and then reload the records from the text file.C.Use the DBCC CHECKIDENT statement to reseed the Sales table's IDENTITY property.D.Set the Sales table's IDENTITY_INSERT property to ON. Add new sales records that have the desired key values.

下列说法正确的是()A.alter table user drop column sex;B.alter table user add sex varchar(20);C.alter table user drop sex;D.alter table user modify id int primary key;

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 own a table called EMPLOYEES with this table structure: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2(25)LAST_NAME VARCHAR2(25)HIRE_DATE DATEWhat 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.

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);

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.

某数据库系统中,假设有部门关系 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);

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.

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

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.

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.

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.

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);

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、CHECKB、UNIQUEC、NOT NULLD、PRIMARY KEYE、FOREIGN KEY

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.

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.

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.

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.

单选题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.

单选题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?()AYou should drop the XML index on the table. Modify the primary key. Recreate the XML index BYou 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. CYou 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. DYou should disable the XML index on the GoodsDetails column. Modify the primary key.Enable the XML index on the ProductSpecs column.

单选题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; ()AYou get an error because of a primary key violation.BThe data and structure of the EMPLOYEES table are deleted.CThe data in the EMPLOYEES table is deleted but not the structure.DYou get an error because the statement is not syntactically correct.

单选题Which statement explicitly names a constraint?()AALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);BALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);CALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);DALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);EALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);

单选题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?()AALTER TABLE students ADD PRIMARY KEY _ id;BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);CALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;DALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);EALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

多选题Which two statements are true about the primary key constraint in a table? ()AIt is not possible to disable the primary key constraint.BIt is possible to have more than one primary key constraint in a single table.CThe primary key constraint can be referred by only one foreign key constraint.DThe primary key constraint can be imposed by combining more than one column.EThe non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.

多选题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?()AALTER DATABASE FLASHBACK ONBGRANT SELECT any transaction TO scottCGRANT EXECUTE ON dbms_flashback TO scottDALTER DATABASE ADD SUPPLEMENTAL LOG DATAEALTER TABLESPACE undots1 RETENTION GUARANTEEFALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS

单选题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?()ACREATE 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));BCREATE 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));CCREATE TABLE student_grades(student_id NUMBER(12),semester_end DATE, gpa NUMBER(4,3), CONSTRAINT FOREIGN KEY (student_id) REFERENCES student (student_id));DCREATE 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));

单选题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?()AALTER TABLE students ADD PRIMARY KEY student_id;BALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);CALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;DALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);EALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

单选题要向雇员表中的部门标识列添加FOREIGNKEY约束条件以引用部门表中的标识列,应该使用哪个语句()AALTER TABLE雇员MODIFY COLUMN dept_id_fk FOREIGN KEY(部门标识)REFERENCES部门(部门标识)BALTER TABLE雇员ADD CONSTRAINT dept_id_fk FOREIGNKEY(部门标识)REFERENCES部门(部门标识)CALTER TABLE雇员ADD FOREIGN KEY CONSTRAINT dept_id_fk ON(部门标识)REFERENCES部门(部门标识)DALTER TABLE雇员ADD FOREIGN KEY 部门(部门标识)REFERENCES(部门标识)