SQL Extensions   «Prev  Next»

FOREIGN KEY, CHECK, and UNIQUE constraints - Exercise

Identify Components of Constraints

Objective: Match SQL constraints with their descriptions.

Exercise Instructions

This exercise involves matching SQL code snippets to descriptions.
Match the letter that correctly identifies the item to which the arrow points.
When you think you have all the SQL code snippets and their descriptions matched correctly, click Submit to check your work. When you have completed the exercise, click the Submit button to see the correct answers.

Exercise scoring

You will receive nine points for this exercise. The exercise is auto-scored; when you have completed the exercise, click the Submit button to receive full credit.
  1. NUMBER(10,3)
  2. NOT NULL
  3. CHECK (JOB_TYPE IN ('W','B','X')
  4. CONSTRAINT J_PK PRIMARY KEY (CUST_ID, SALES_ID)
  5. FOREIGN KEY (SALES_ID) REFERENCES CUSTOMER_SALE
  6. INIT 50K
  7. CONSTRAINT PROD_FK FOREIGN KEY (PROD_ID, SALES_ID) REFERENCES CUSTOMER_PRODUCT
  8. CONSTRAINT GET_IT UNIQUE (CUST_ID, PROD_ID)
  9. SSI_NUM VARCHAR2(10) UNIQUE

  1. Definition of item COLUMN constraint
  2. Definition of item CHECK constraint
  3. Definition of item Column datatype
  4. Definition of item FOREIGN KEY constraint
  5. Definition of item Storage parameter
  6. Definition of item PRIMARY KEY constraint
  7. Definition of item TABLE constraint
  8. Definition of item UNIQUE COLUMN constraint
  9. Definition of item UNIQUE TABLE constraint