Chapter 4

Home > Preview

The flashcards below were created by user Lencha on FreezingBlue Flashcards.


  1. Any type of constraint for a single column can be created at the column level
    True
  2. A constraint name can consist of up to 25 characters and numbers.
    False
  3. A constraint name can consist of up to 10 characters.
    False
  4. A(n) FOREIGN KEY constraint is used to ensure that referential integrity exists between tables.
    True
  5. When a FOREIGN KEY constraint is being created, the REFERENTIAL keyword is used to indicate the table being referenced.
    False
  6. A constraint can only be created as part of the CREATE TABLE command.
    False
  7. If a data value violates a(n) constraint, the entire row is prevented from being added to the table.
    True
  8. Each column can only be included in one constraint.
    False
  9. If a(n) FOREIGN KEY constraint has been created for a table, it means the data values in that column must be unique and cannot contain NULL values.
    False
  10. With the exception of the NOT NULL constraint, constraints can be added to a table using the ADD clause of the ALTER TABLE command.
    True
  11. A NOT NULL constraint can only be created at the column level.
    True
  12. The MODIFY clause is used with the ALTER TABLE command to add a PRIMARY KEY constraint to an existing table.
    False
  13. A constraint can be renamed using the ALTER TABLE command.
    False
  14. The ALTER TABLE command can be used to delete an existing constraint.
    True
  15. A(n) NOT NULL constraint is a special CHECK constraint with the condition of IS NOT NULL.
    True
  16. A foreign key constraint can only be created at the column level.
    False
  17. The CONSTRAINT keyword is required if the user is going to assign a name to a constraint.
    True
  18. A NOT NULL constraint can only be added to an existing table by using the ADD clause with the ALTER TABLE command.
    False
  19. The ALTER TABLE command can be used to disable a constraint.
    True
  20. A(n) constraint can be created during the creation of a database table or added to a table afterwards.
    True
  21. A CHECK constraint requires that a data value meet a certain condition before the record is added to the database table.
    True
  22. Any constraint can be created at the table or the column level.
    False
  23. A constraint is always enforced at the table level.
    True
  24. A primary key is usually given the abbreviation _pk in the constraint name if the name is assigned by the user.
    True
  25. The table level approach can be used to create any constraint, except a CHECK constraint.
    False
  26. If the constraints on the ORDER# and ITEM# columns of the ORDERITEMS table were created as a PRIMARY constraint, and the actual constraint name is not known, which of the following commands can be used to delete the constraint?

    A. ALTER TABLE orderitems
    DROP ALL CONSTRAINTS;

    B. ALTER TABLE orderitems
    DELETE ALL CONSTRAINTS;

    C. ALTER TABLE orderitems
    DROP PRIMARY KEY;

    D. ALTER TABLE orderitems
    DELETE PRIMARY KEY;
    C. ALTER TABLE orderitemsDROP PRIMARY KEY;
  27. Which of the following commands will add a UNIQUE constraint to the MINRETAIL column of the PROMOTION table?

    A. ALTER TABLE promotion
    ADD CONSTRAINT orderitems_minretail_uk UNIQUE (minretail);

    B. ALTER TABLE promotion
    MODIFY UNIQUE (minretail);


     
    C.
    ALTER TABLE promotion
    ADD UNIQUE minretail;


     
    D.
    ALTER TABLE promotion
    MODIFY minretail;

Card Set Information

Author:
Lencha
ID:
324943
Filename:
Chapter 4
Updated:
2016-11-18 09:13:27
Tags:
SQL Joan Casteel
Folders:
Co Sci 186
Description:
Chapter 4
Show Answers:

Home > Flashcards > Print Preview