duminică, 2 mai 2010

Test: Quiz: Primary Key, Foreign Key, and Check Constraints

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1
1. The employees table contains a foreign key column department_id that references the id column in the departments table. Which of the following constraint modifiers will NOT allow the deletion of id values in the department table? Mark for Review

(1) Points
ON DELETE CASCADE
ON DELETE SET NULL
Neither A nor B (*)
Both A and B
Correct Correct
2. The table that contains the Primary Key in a Foreign Key Constraint is known as: Mark for Review

(1) Points
Child Table
Parent Table (*)
Detail Table
Mother and Father Table
Correct Correct
3. If a Primary Key is made up of more than one column, one of the columns can be null. True or False? Mark for Review

(1) Points
True
False (*)
Correct Correct
4. The main reason that constraints are added to a table is: Mark for Review

(1) Points
Constraints add a level of complexity
Constraints ensure data integrity (*)
Constraints gives programmers job security
None of the Above
Correct Correct
5. A composite primary key may only be defined at the table level. True or False? Mark for Review

(1) Points
True (*)
False
Correct Correct
6. To automatically delete rows in a child table when a parent record is deleted use: Mark for Review

(1) Points
ON DELETE SET NULL
ON DELETE ORPHAN
ON DELETE CASCADE (*)
None of the Above
Correct Correct
7. The number of check constraints that can be defined on a column is: Mark for Review

(1) Points
10
5
100
There is no limit (*)
Correct Correct
8. A Primary Key that is made up of more than one column is called a: Mark for Review

(1) Points
Multiple Primary Key
Composite Primary Key (*)
Double Key
Primary Multi-Key
None of the Above
Correct Correct
9. An example of adding a check constraint to limit the salary that an employee can earn is: Mark for Review

(1) Points
ALTER TABLE employees ADD CONSTRAINT emp_salary_ck SALARY <>
ALTER TABLE employees CONSTRAINT emp_salary_ck CHECK(salary <>
MODIFY TABLE employees ADD CONSTRAINT emp_salary_ck CHECK(salary <>
ALTER TABLE employees ADD CONSTRAINT emp_salary_ck CHECK (salary <>
Correct Correct
10. Foreign Key Constraints are also known as: Mark for Review

(1) Points
Parental Key Constraints
Child Key Constraints
Referential Integrity Constraints (*)
Multi-Table Constraints
Correct Correct
11. Which of the following pieces of code will NOT successfully create a foreign key in the CDS table that references the SONGS table Mark for Review

(1) Points
CONSTRAINT d_cd_ song_id_fk FOREIGN KEY (song_id)REFERENCES d_songs(id)
CONSTRAINT k_cd_songid_fk FOREIGN KEY (song_id)REFERENCES d_songs(id)
song_id NUMBER(5) CONSTRAINT d_cd_ song_id_fk REFERENCES d_songs(id)
None of the above (*)
Correct Correct






( Vrei sa traduci ceva?Want to translate something? http://translate.google.ro/# )

Niciun comentariu:

Trimiteți un comentariu