sâmbătă, 8 mai 2010

Test: Final Exam Semester 2 - Part I (41-50)

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Part I of the Semester 2 Final Exam covers Sections 8-9 of Database Programming with SQL.
Section 9
41. Which statement should you use to add a FOREIGN KEY constraint to the DEPARTMENT_ID column in the EMPLOYEES table to refer to the DEPARTMENT_ID column in the DEPARTMENTS table? Mark for Review
(1) Points
ALTER TABLE employees
MODIFY COLUMN dept_id_fk FOREIGN KEY (department_id) REFERENCES departments(department_id);
ALTER TABLE employees
ADD CONSTRAINT dept_id_fk FOREIGN KEY (department_id) REFERENCES departments(department_id);

(*)

ALTER TABLE employees
ADD FOREIGN KEY CONSTRAINT dept_id_fk ON (department_id) REFERENCES departments(department_id);
ALTER TABLE employees
ADD FOREIGN KEY departments(department_id) REFERENCES (department_id);
Correct Correct
42. You need to add a PRIMARY KEY to the DEPARTMENTS table. Which statement should you use? Mark for Review
(1) Points
ALTER TABLE departments ADD PRIMARY KEY dept_id_pk (dept_id);
ALTER TABLE departments ADD CONSTRAINT dept_id_pk PK (dept_id);
ALTER TABLE departments ADD CONSTRAINT dept_id_pk PRIMARY KEY (dept_id); (*)
ALTER TABLE departments ADD CONSTRAINT PRIMARY KEY dept_id_pk (dept_id);
Correct Correct
43. You want to disable the FOREIGN KEY constraint that is defined in the EMPLOYEES table on the DEPARTMENT_ID column. The constraint is referenced by the name FK_DEPT_ID_01. Which statement should you issue? Mark for Review
(1) Points
ALTER TABLE employees DISABLE 'fk_dept_id_01';
ALTER TABLE employees DISABLE CONSTRAINT 'fk_dept_id_01';
ALTER TABLE employees DISABLE fk_dept_id_01;
ALTER TABLE employees DISABLE CONSTRAINT fk_dept_id_01; (*)
Correct Correct
44. What is the highest number of NOT NULL constraints you can have on a table? Mark for Review
(1) Points
5
10
3
You can have as many NOT NULL constraints as you have columns in your table. (*)
Correct Correct
45. Which two statements about NOT NULL constraints are true? (Choose two) Mark for Review
(1) Points
(Choose all correct answers)
The Oracle Server creates a name for an unnamed NOT NULL constraint. (*)
A NOT NULL constraint can be defined at either the table or column level.
The NOT NULL constraint requires that every value in a column be unique.
Columns without the NOT NULL constraint can contain null values by default.
You CANNOT add a NOT NULL constraint to an existing column using the ALTER TABLE ADD CONSTRAINT statement. (*)
Correct Correct
46. You need to add a NOT NULL constraint to the COST column in the PART table. Which statement should you use to complete this task? Mark for Review
(1) Points
ALTER TABLE part
MODIFY (cost part_cost_nn NOT NULL);
ALTER TABLE part
MODIFY (cost CONSTRAINT part_cost_nn NOT NULL);

(*)

ALTER TABLE part
MODIFY COLUMN (cost part_cost_nn NOT NULL);
ALTER TABLE part
ADD (cost CONSTRAINT part_cost_nn NOT NULL);
Correct Correct
47. You need to ensure that each value in the SEAT_ID column is unique or null. Which constraint should you define on the SEAT_ID column? Mark for Review
(1) Points
CHECK
UNIQUE (*)
NOT NULL
PRIMARY KEY
Correct Correct
48. Primary Key, Foreign Key, Unique Key and Check Constraints can be added at which two levels? (Choose two) Mark for Review
(1) Points
(Choose all correct answers)
Null Field
Table (*)
Row
Dictionary
Column (*)
Correct Correct
49. You need to ensure that the LAST_NAME column only contains certain character values. No numbers or special characters are allowed. Which type of constraint should you define on the LAST_NAME column? Mark for Review
(1) Points
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
Correct Correct
50. Which statement about constraints is true? Mark for Review
(1) Points
A single column can have only one constraint applied.
PRIMARY KEY constraints can only be specified at the column level.
NOT NULL constraints can only be specified at the column level. (*)
UNIQUE constraints are identical to PRIMARY KEY constraints.
Correct Correct

Niciun comentariu:

Trimiteți un comentariu