Section 12 Quiz
Section 12 Quiz
Section 12 Quiz
CLASS_ASSIGNMENTS:
CLASS_ID NUMBER(5)
TEACHER_ID NUMBER(5)
START_DATE DATE
MAX_CAPACITY NUMBER(3)
Which scenario would require a subquery to return the desired results?
You need to display the start date for each class taught by a given
teacher.
You need to create a report to display the teachers who were hired
more than five years ago.
You need to display the names of the teachers who teach classes
that start within the next week.
You need to create a report to display the teachers who teach more
classes than the average number of classes taught by each teacher.
(*)
Correct
4.DELETE statements can use correlated subqueries? (True or False)
True (*)
False
Correct
5.The EMPLOYEES table contains the following columns:
EMPLOYEE_ID NUMBER(10) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
DEPTARTMENT_ID VARCHAR2(20)
HIRE_DATE DATE
SALARY NUMBER(9,2)
BONUS NUMBER(9,2)
You need to increase the salary for all employees in department 10 by
10 percent. You also need to increase the bonus for all employees in
department 10 by 15 percent. Which statement should you use?
UPDATE employees
SET (salary = salary * 1.10) SET (bonus = bonus * 1.15)
WHERE department_id = 10;
UPDATE employees
SET salary = salary * .10, bonus = bonus * .15
WHERE department_id = 10;
UPDATE employees
SET salary = salary * 1.10 AND bonus = bonus * 1.15
WHERE department_id = 10;
UPDATE employees
SET salary = salary * 1.10, bonus = bonus * 1.15
WHERE department_id = 10;
(*)
Section 12 Quiz
(Answer all questions in this section)
6. You need to add a row to an existing table. Which DML statement
should you use?
INSERT (*)
DELETE
UPDATE
CREATE
Correct
7. The PRODUCTS table contains these columns:
PROD_ID NUMBER(4)
PROD_NAME VARCHAR2(25)
PROD_PRICE NUMBER(3)
You want to add the following row of data to the PRODUCTS table:
(1) a NULL value in the PROD_ID column
(2) "6-foot nylon leash" in the PROD_NAME column
(3) "10" in the PROD_PRICE column
You issue this statement:
INSERT INTO products
True
False (*)
Correct
9. You need to copy rows from the EMPLOYEE table to the
EMPLOYEE_HIST table. What could you use in the INSERT
statement to accomplish this task?
A function
An ON clause
A SET clause
A subquery (*)
Correct
10.What is the quickest way to use today's date when you are creating a
new row?
True (*)
False
Incorrect. Refer to Section 12 Lesson 3.
12. The MERGE function combines the:
True (*)
False
Correct
14. The default value must match the __________ of the
column.
Datatype (*)
Size
Table
Column name
Correct
15. Using MERGE accomplishes an __________ and
__________ simultaneously.
UPDATE; DELETE
INSERT; SELECT
INSERT; UPDATE (*)
UPDATE; SELECT
Correct
Page 3 of 3
Section 13 Quiz
(Answer all questions in this section)
1.Which column name is valid?
NUMBER_1$ (*)
NUMBER
1_NUMBER#
1NUMBER
Correct
2.CREATE TABLE student_table
(id NUMBER(6),
lname VARCHAR(20),
fname VARCHAR(20),
lunch_num NUMBER(4));
True (*)
False
Correct
4.Which statement about creating a table is true?
PRODUCTS_(2001)
PRODUCTS--2001
Correct
Page 1 of 3
Section 13 Quiz
(Answer all questions in this section)
6. INTERVAL DAY TO SECOND stores a
period of time in terms of days, hours,
minutes, and seconds. True or False?
True (*)
False
Correct
7. Evaluate this CREATE TABLE
statement:
CREATE TABLE sales
(sales_id NUMBER,
customer_id NUMBER,
employee_id NUMBER,
sale_date TIMESTAMP WITH TIME
ZONE,
sale_amount NUMBER(7,2));
Which statement about the
SALE_DATE column is true?
Data stored in the column will be
returned in the database's local time
zone. (*)
Data will be stored using a
fractional seconds precision of 5.
Data will be normalized to the client
time zone.
Data stored will not include
seconds.
Correct
True
False (*)
Correct
9. You need to store the HIRE_DATE
value with a time zone displacement
value and allow data to be returned in
the user's local session time zone. Which
data type should you use?
TIMESTAMP
DATETIME
TIMESTAMP WITH LOCAL TIME
ZONE (*)
TIMESTAMP WITH TIME ZONE
Correct
10. The ELEMENTS column is defined as:
NUMBER(6,4)
How many digits to the right of the
decimal point are allowed for the
ELEMENTS column?
Two
Four (*)
Zero
Six
Correct
Section 13 Quiz
(Answer all questions in this section)
11. When should you use the SET UNUSED command?
(1) Points
You should use it when you need a quick way of
dropping a column. (*)
You should use it if you think the column may
be needed again later.
You should only use this command if you want
the column to still be visible when you
DESCRIBE the table.
Never, there is no SET UNUSED command.
Incorrect. Refer to Section 13 Lesson 3.
12. Which statement about decreasing the width of a
column is true?
Correct
14. You want to issue the following command on a
database that includes your company's inventory
information:
ALTER TABLE products SET UNUSED COLUMN
color;
Parentheses ( )
Brackets { }
Double quotes " "
Single quotes ' ' (*)
Correct
Page 3 of 3
Section 14 Quiz
(Answer all questions in this section)
1. What must exist on the Parent table before Oracle will allow you to create a FOR
2. The table that contains the Primary Key in a Foreign Key Constraint is known as
Detail Table
Parent Table (*)
Child Table
Mother and Father Table
Correct
3. When creating a referential constraint, which keyword(s) identifies the table and
REFERENCES (*)
FOREIGN KEY
ON DELETE SET NULL
ON DELETE CASCADE
Correct
4. Foreign Key Constraints are also known as:
5. Which type of constraint by default requires that a column be both unique and no
FOREIGN KEY
PRIMARY KEY (*)
CHECK
UNIQUE
Correct
Page 1 of 3
Section 14 Quiz
(Answer all questions in this section)
6. What actions can be performed on or with Constraints?
Correct
8. Examine the structures of the PRODUCTS and
SUPPLIERS tables.
PRODUCTS:
PRODUCT_ID NUMBER NOT NULL, PRIMARY
KEY
PRODUCT_NAME VARCHAR2 (25)
SUPPLIER_ID NUMBER FOREIGN KEY to
SUPPLIER_ID of the SUPPLIER table
LIST_PRICE NUMBER (7,2)
COST NUMBER (7,2)
QTY_IN_STOCK NUMBER
QTY_ON_ORDER NUMBER
REORDER_LEVEL NUMBER
REORDER_QTY NUMBER
SUPPLIERS:
SUPPLIER_ID NUMBER NOT NULL, PRIMARY
KEY
SUPPLIER_NAME VARCHAR2 (25)
ADDRESS VARCHAR2 (30)
CITY VARCHAR2 (25)
REGION VARCHAR2 (10)
POSTAL_CODE VARCHAR2 (11)
Evaluate this statement:
ALTER TABLE suppliers
DISABLE CONSTRAINT supplier_id_pk CASCADE;
For which task would you issue this statement?
To remove all constraint references to the
PRODUCTS table
To drop the FOREIGN KEY constraint on the
PRODUCTS table
To remove all constraint references to SUPPLIERS
table
To disable any dependent integrity constraints on the
SUPPLIER_ID column in the SUPPLIERS table (*)
To disable any dependent integrity constraints on the
SUPPLIER_ID column in the PRODUCTS table
Correct
SYS_DATA_DICT_COLUMNS
US_CON_SYS
CONSTRAINTS_ALL_COLUMNS
USER_CONS_COLUMNS (*)
Correct
Page 2 of 3
Section 14 Quiz
(Answer all questions in this section)
11.What is the highest number of NOT NULL constraints you can have
on a table?
5
10
3
You can have as many NOT NULL constraints as you have
columns in your table. (*)
Correct
12.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?
UNIQUE (*)
CHECK
NOT NULL
PRIMARY KEY
Correct
13.Which statement about the NOT NULL constraint is true?
Correct
15.A unique key constraint can only be defined on a not null column.
True or False?
True
False (*)
Correct
Page 3 of 3