Only Click My Ads Brother, Help this Site Alive

Wednesday, February 8, 2017

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

Test: Final Exam Semester 2 - Part I (41-50)
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 9
(Answer all questions in this section)

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? 

(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);


42. You need to add a PRIMARY KEY to the DEPARTMENTS table. Which statement should you use? 

(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);


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?
(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; (*)

44. What is the highest number of NOT NULL constraints you can have on a table?

(1) Points

5

10
3

You can have as many NOT NULL constraints as you have columns in your table. (*)


45. Which two statements about NOT NULL constraints are true? (Choose two)
(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. (*)


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? 
(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);


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?
(1) Points

CHECK

UNIQUE (*)

NOT NULL

PRIMARY KEY

48. Primary Key, Foreign Key, Unique Key and Check Constraints can be added at which two levels? (Choose two) 

(1) Points
(Choose all correct answers)

Null Field

Table (*)

Row

Dictionary

Column (*)


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?
(1) Points

CHECK (*)

UNIQUE

NOT NULL

PRIMARY KEY

50. Which statement about constraints is true? 

(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.


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

No comments:

Post a Comment