Test: Final Exam Semester 2 - Part I (1-10)
Test: Final Exam Semester 2 - Part I (1-10)
Test: Final Exam Semester 2 - Part I (1-10)
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 8
Correct
Correct
1
2
3
4 (*)
Correct
4. You are creating the EMPLOYEES table. This table should contain the
COMMISSION_PCT column and use a value of 10 percent if no Mark for Review
commission value is provided when a record is inserted. Which line (1) Points
should you include in the CREATE TABLE statement to accomplish
this task?
Correct
Correct
1NUMBER
NUMBER
NUMBER_1$ (*)
1_NUMBER#
Correct
7. You are designing a table for the Human Resources department. This
table must include a column that contains each employee's hire date. Mark for Review
Which data type should you specify for this column? (1) Points
CHAR
DATE (*)
TIMESTAMP
INTERVAL YEAR TO MONTH
Correct
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
Correct
DATETIME
TIMESTAMP
TIMESTAMP WITH TIME ZONE
TIMESTAMP WITH LOCAL TIME ZONE (*)
Correct
Zero
Two
Four (*)
Six
Correc
Test: Final Exam Semester 2 - Part I (11-20)
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 8
11.Which statement about data types is true?
Mark for Review
(1) Points
Correct
12.You are designing a table for the Sales department. You need to
include a column that contains each sales total. Which data type Mark for Review
should you specify for this column? (1) Points
CHAR
DATE
NUMBER (*)
VARCHAR2
Correct
Correct
Correct
15.Which command could you use to quickly remove all data from the
rows in a table without deleting the table itself? Mark for Review
(1) Points
ALTER TABLE
DROP TABLE
MODIFY
TRUNCATE TABLE (*)
Correct
16.Your supervisor has asked you to modify the AMOUNT column in the
ORDERS table. He wants the column to be configured to accept a Mark for Review
default value of 250. The table constains data that you need to keep. (1) Points
Which statement should you issue to accomplish this task?
(*)
DROP TABLE orders;
CREATE TABLE orders
(orderno varchar2(5) CONSTRAINT pk_orders_01 PRIMARY
KEY,
customerid varchar2(5) REFERENCES customers (customerid),
orderdate date,
amount DEFAULT 250);
DELETE TABLE orders;
CREATE TABLE orders
(orderno varchar2(5) CONSTRAINT pk_orders_01 PRIMARY
KEY,
customerid varchar2(5) REFERENCES customers (customerid),
orderdate date,
amount DEFAULT 250)
Correct
Correct
Correct
19.You need to remove all the rows from the SALES_HIST table. You
want to release the storage space, but do not want to remove the Mark for Review
table structure. Which statement should you use? (1) Points
Correct
Correct
Test: Final Exam Semester 2 - Part I (31-40)
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
CHECK
FOREIGN KEY
PRIMARY KEY (*)
NOT NULL
Correct
Correct
(*)
Correct
34.You need to add a NOT NULL constraint to the EMAIL column in the
EMPLOYEES table. Which clause should you use? Mark for Review
(1) Points
ADD
CHANGE
MODIFY (*)
DISABLE
Correct
35.You can view the columns used in a constraint defined for a specific
table by looking at which data dictionary table? Mark for Review
(1) Points
USER_CONS_COLUMNS (*)
CONSTRAINTS_ALL_COLUMNS
SYS_DATA_DICT_COLUMNS
US_CON_SYS
Correct
(*)
ALTER TABLE salary
ADD CONSTRAINT fk_employee_id_ FOREIGN KEY
BETWEEN salary (employee_id) AND employees (employee_id);
ALTER TABLE salary
FOREIGN KEY CONSTRAINT fk_employee_id_ REFERENCES
employees (employee_id);
ALTER TABLE salary
ADD CONSTRAINT fk_employee_id_ FOREIGN KEY salary
(employee_id) = employees (employee_id);
Correct
37.What is the syntax for removing a PRIMARY KEY constraint and all its
dependent constraints? Mark for Review
(1) Points
(*)
ALTER TABLE table_name
DROP CONSTRAINT FOREIGN KEY CASCADE;
DROP CONSTRAINT table_name (constraint_name);
ALTER TABLE table_name
DROP CONSTRAINT constraint_name;
Correct
Correct
(*)
ALTER TABLE
ADD CONSTRAINT emp_emp_id_pk PRIMARY KEY
employees(emp_id);
ALTER TABLE employees
MODIFY emp_id PRIMARY KEY;
ALTER TABLE employees
MODIFY CONSTRAINT PRIMARY KEY (emp_id);
Correct
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
(*)
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
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
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
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
48.Primary Key, Foreign Key, Unique Key and Check Constraints can be
added at which two levels? (Choose two) Mark for Review
(1) Points
Null Field
Table (*)
Row
Dictionary
Column (*)
Correct
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
Correct
Correct