Which two statements are true about the primary key constraint in a table? ()
第1题:
Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()
A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );
B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );
C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );
第2题:
Which of the following scenarios will ensure that the value of the NEXT_STEPNO column in a given row of table TABLEX exists as a value of column STEPNO (usually in another row) in the same table?()
第3题:
Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()
第4题:
Which two statements are true about constraints? ()
第5题:
Examine the command that is used to create a table: SQL> CREATE TABLE orders(oid NUMBER(6) PRIMARY KEY, odate DATE, ccode NUMBER(6), oamt NUMBER(10,2)) TABLESPACE users; Which two statements are true about the effect of the above command) ()
第6题:
Which constraint can be defines only at the column level?()
第7题:
Which statements are correct regarding indexes? ()
第8题:
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()
第9题:
The constraint remains valid.
The index on the constraint is dropped.
It allows the loading of data into the table using SQL *Loader.
New data conforms to the constraint, but existing data is not checked.
It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.
第10题:
The PRIMARY KEY is created along with a new index.
The PRIMARY KEY is created and it would use an existing unique index.
The PRIMARY KEY would be created in a disabled state because it is using an existing index.
The statement produces an error because the USING clause is permitted only in the CREATE TABLE command.
第11题:
It is not possible to disable the primary key constraint.
It is possible to have more than one primary key constraint in a single table.
The primary key constraint can be referred by only one foreign key constraint.
The primary key constraint can be imposed by combining more than one column.
The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.
第12题:
The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.
The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.
The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.
The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.
第13题:
为表TEST中ID列添加主键约束的语法是()
第14题:
数据库中的中的PROFITS表中PRODUCT_NAME与SALE_PERIOD列建立主键。下列哪个语句无法定义这个主键?()
第15题:
When defining a referential constraint between the parent table T2 and the dependent table T1, which of the following is true?()
第16题:
You execute this command to drop the ITEM table, which has the primary key referred in the ORDERtable: SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE; Which two statements are true about the effect of the command()
第17题:
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?()
第18题:
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?()
第19题:
You execute this command to drop the ITEM table, which has the primary key referred in the ORDERS table:SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE; Which two statements are true about theeffect of the command()
第20题:
A CHECK constraint is created on the OID column.
A NOT NULL constraint is created on the OID column.
The ORDERS table is the only object created in the USERS tablespace.
The ORDERS table and a unique index are created in the USERS tablespace.
The ORDERS table is created in the USERS tablespace and a unique index is created on the OID columnin the SYSTEM tablespace.
第21题:
ALTER TABLE students ADD PRIMARY KEY _ id;
ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
第22题:
The UNIQUE constraint does not permit a null value for the column.
A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.
The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.
The NOT NULL constraint ensures that null values are not permitted for the column.
第23题:
When a table is dropped, the corresponding indexes are automatically dropped.
For each DML operation performed, the corresponding indexes are automatically updated.
Indexes should be created on columns that are frequently referenced as part of an expression.
A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a uniqueindex.