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 will also be dropped?
Please select all the correct answers.
  A. A PRIMARY KEY constraint on the table
  B. A synonym for the table
  C. An index on the table
  D. A view using 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 change cannot be done by using the ALTER TABLE command?
Please select the best answer.
  A. Change a column from NUMBER(10,0) to NUMBER(5,0).
  B. Change a column from PRODUCT_ID to PRODUCT_NO.
  C. Change a column from CHAR(100) to VARCHAR2(100).
  D. Change a column from allowing nulls to not allowing nulls.

4. Assume you have two tables with a parent/child relationship defined with the following SQL command:
Please select the best answer.
  A. ALTER TABLE CHILD_TAB DISABLE CONSTRAINT PARENT_KEY;
  B. ALTER TABLE PARENT_TAB CONSTRAINT PARENT_KEY ON DELETE CASCADE;
  C. ALTER TABLE PARENT_TAB DISABLE CONSTRAINT PARENT_KEY;
  D. ALTER TABLE CHILD_TAB DROP CONSTRAINT ON PARENT_KEY;