SQL Extensions   «Prev  Next»

Removing Tables Constraints - Quiz

Each question is worth one point. Select the best answer or answers for each question.
1. You are about to drop a table. Which of the following objects are dropped with the table?
Please select all the correct answers.
  A. A PRIMARY KEY constraint defined on the table
  B. A synonym that resolves to the table
  C. An index defined on the table
  D. A view that depends on the table

2. Examine the following SQL commands. Which line contains a syntax error?
Please select the best answer.
  A. 1 ALTER TABLE PET_STORE ADD (PET_ID NUMBER(10,0));
  B. 2 ALTER TABLE PET_STORE ADD CONSTRAINT PET_PK PRIMARY KEY (PET_ID);
  C. 3 ALTER TABLE PET_STORE DISABLE CONSTRAINT PET_PK;
  D. 4 DROP TABLE PET_STORE CASCADE;

3. Which statement correctly renames PRODUCT_ID to PRODUCT_NO in the PRODUCT table?
Please select the best answer.
  A. ALTER TABLE PRODUCT RENAME COLUMN PRODUCT_ID TO PRODUCT_NO;
  B. ALTER TABLE PRODUCT MODIFY (PRODUCT_ID RENAME TO PRODUCT_NO);
  C. RENAME COLUMN PRODUCT.PRODUCT_ID TO PRODUCT_NO;
  D. ALTER TABLE PRODUCT CHANGE PRODUCT_ID PRODUCT_NO NUMBER;

4. An enabled foreign key named CHILD_PARENT_FK is defined on CHILD_TAB and references PARENT_TAB. Which statement disables that foreign key?
Please select the best answer.
  A. ALTER TABLE CHILD_TAB DISABLE CONSTRAINT CHILD_PARENT_FK;
  B. ALTER TABLE PARENT_TAB DISABLE CONSTRAINT CHILD_PARENT_FK;
  C. ALTER TABLE CHILD_TAB DROP CONSTRAINT ON CHILD_PARENT_FK;
  D. ALTER TABLE CHILD_TAB DISABLE CHILD_PARENT_FK;

5. What does CASCADE CONSTRAINTS do when PARENT_TAB is dropped?
Please select the best answer.
  A. It deletes every row from all child tables before dropping PARENT_TAB.
  B. It drops foreign keys that reference keys in PARENT_TAB but leaves the child tables and their rows in place.
  C. It bypasses the recycle bin and permanently removes every related object.
  D. It disables every constraint in the schema.