Final Examsql
Final Examsql
Final Examsql
Correct Correct
You are a member of the SYSDBA role, but are not logged in as SYSDBA. You
issue this CREATE TABLE statement.
Which statement is true?
Mark for Review
(1) Points
Correct Correct
Correct Correct
Section 8 Lesson 2
Correct Correct
7. Which statement about data types is true? Mark for
Review
(1) Points
The CHAR data type requires that a minimum size be specified when
defining a column of this type. (*)
Correct Correct
DATE
DATETIME
TIMESTAMP (*)
NCHAR
CLOB (*)
VARCHAR2 (*)
CHAR
DATE (*)
TIMESTAMP
Correct Correct
11. You need to store the SEASONAL data in months and years.
Which data type should you use? Mark for Review
(1) Points
DATE
TIMESTAMP
12. You are designing a table for the Sales department. You
need to include a column that contains each sales total. Which data type
should you specify for this column? Mark for Review
(1) Points
CHAR
DATE
NUMBER (*)
VARCHAR2
Section 8 Lesson 3
13. You need to remove all the data in the SCHEDULE table,
the structure of the table, and the indexes associated with the table.
Which statement should you use? Mark for Review
(1) Points
TRUNCATE TABLE
ALTER TABLE
DELETE TABLE
Correct Correct
When a character column contains data, you can decrease the width
of the column without any restrictions.
When a character column contains data, you can decrease the width
of the column if the existing data does not violate the new size. (*)
Correct Correct
16. Comments on tables and columns can be stored for
documentation by: Mark for Review
(1) Points
You need to remove the EMPLOYEE_ID column from the EMPLOYEES table. Which
statement could you use to accomplish this task?
Mark for Review
(1) Points
Correct Correct
Frees the disk space used by the data in the FAX column
Prevents a new FAX column from being added to the EMPLOYEES table
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
Which statement should you use to increase the LAST_NAME column length to
35 if the column currently contains 200 records?
Mark for Review
(1) Points
22. 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 table structure. Which statement should you use? Mark for Review
(1) Points
DONATIONS:
PLEDGE_ID NUMBER
DONOR_ID NUMBER
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
You must use the ADD OR REPLACE option to achieve these results.
Section 9 Lesson 1
Columns without the NOT NULL constraint can contain null values by
default.
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
NOT NULL constraints can only be specified at the column level. (*)
Correct Correct
FOREIGN KEY
UNIQUE
CHECK
Null Field
Table (*)
Row
Dictionary
Column (*)
Section 9 Lesson 2
8 (*)
ON DELETE CASCADE
REFERENTIAL
REFERENCES (*)
1. The table must contain the EMPLOYEE_ID and TASKED_HOURS columns for
numeric data.
2. The table must contain the START_DATE and END_DATE column for date
values.
3. The table must contain the HOURLY_RATE and PROJECT_COST columns for
numeric data with precision and scale of 5,2 and 10,2 respectively.
4. The table must have a composite primary key on the EMPLOYEE_ID and
START_DATE columns.
How many of the requirements does the CREATE TABLE statement satisfy?
Mark for Review
(1) Points
36. What must exist on the Parent table before Oracle will
allow you to create a FOREIGN KEY constraint from a Child table? Mark
for Review
(1) Points
Correct Correct
37. You need to create a composite primary key constraint on
the EMPLOYEE table. Which statement is true? Mark for Review
(1) Points
The PRIMARY KEY constraint must be defined at the table level. (*)
The PRIMARY KEY constraint must be defined for the first column of
the composite primary key.
The PRIMARY KEY constraint must be defined at the table level and
for each column in the composite primary key.
Section 9 Lesson 3
FOREIGN KEY
REFERENCES
CASCADE (*)
Correct Correct
Correct Correct
ADD
CHANGE
MODIFY (*)
ENABLE
Correct Correct
PRODUCT
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
SUPPLIER
SUPPLIER_ID NUMBER NOT NULL, Primary Key
SUPPLIER_NAME VARCHAR2 (25)
ADDRESS VARCHAR2 (30)
CITY VARCHAR2 (25)
REGION VARCHAR2 (10)
POSTAL_CODE VARCHAR2 (11)
Correct Correct
DBA_CONSTRAINTS
USER_CONSTRAINTS (*)
ALL_CONS_COLUMNS
USER_CONS_COLUMNS
EMPLOYEE_ID NUMBER
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER
JOB_ID NUMBER
MANAGER_ID NUMBER
SALARY NUMBER(9,2)
HIRE_DATE DATE
(*)
Section 10 Lesson 1
HAVING
WHERE
ORDER BY
49. You need to create a view that when queried will display
the name, employee identification number, first and last name, salary,
and department identification number. When queried, the display should be
sorted by salary from lowest to highest, then by last name and first name
alphabetically. The view definition should be created regardless of the
existence of the EMPLOYEES table. No DML may be performed when using this
view. Evaluate these statements:
When both statements are executed all of the desired results are
achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not
exist. (*)
The statements will NOT return all of the desired results because
the WITH CHECK OPTION clause is NOT included in the CREATE VIEW
statement.
Correct Correct
FORCE (*)
NOFORCE
OR REPLACE
Correct Correct
Previous Page 5 of 10 Next Summary
You have been asked to compile a report that identifies all adjunct
professors who will be teaching classes in the upcoming term. You want to
create a view that will simplify the creation of this report. Which
CREATE VIEW statements will accomplish this task?
Mark for Review
(1) Points
CREATE VIEW
(SELECT first_name, last_name, status, courseid, subject, term
FROM faculty, course
WHERE facultyid = facultyid);
(*)
Views allow access to the data because the view displays all of the
columns from the table.
Views are used when you only want to restrict DML operations using
a WITH CHECK OPTION.
Views are not valid unless you have more than one user.
Correct Correct
53. Which option would you use to modify a view rather than
dropping it and recreating it? Mark for Review
(1) Points
FORCE
NOFORCE
You cannot update data in the EMPLOYEES table using the EMP_VIEW
view. (*)
You can update any data in the EMPLOYEES table using the EMP_VIEW
view.
You can delete records from the EMPLOYEES table using the EMP_VIEW
view.
You can update only the SALARY column in the EMPLOYEES table using
the EMP_VIEW view.
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still
returns the original data from those tables.
Incorrect Incorrect. Refer to Section 10
Section 10 Lesson 2
a WHERE clause
You can delete data in a view if the view contains the DISTINCT
keyword.
You cannot perform DML operations on a view that contains the WITH
CHECK OPTION clause.
You can perform DML operations on a view that contains the WITH
READ ONLY option.
To make sure no rows are updated through the view that will hinder
those rows from being returned by the view. (*)
They derive data from many tables, so they typically contain joins.
61. Your manager has just asked you to create a report that
illustrates the salary range of all the employees at your company. Which
of the following SQL statements will create a view called SALARY_VU based
on the employee last names, department names, salaries, and salary grades
for all employees? Use the EMPLOYEES, DEPARTMENTS, and JOB_GRADES tables.
Label the columns Employee, Department, Salary, and Grade, respectively.
Mark for Review
(1) Points
True (*)
False
Correct Correct
Section 10 Lesson 3
Correct Correct
64. Evaluate this CREATE VIEW statement:
You can modify data in the SALES table using the SALES_VIEW view.
You cannot modify data in the SALES table using the SALES_VIEW
view. (*)
You can only insert records into the SALES table using the
SALES_VIEW view.
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
You created a Top-n query report that displays the account numbers and
new balance of the 800 accounts that have the highest new balance value.
The results are sorted by payments value from highest to lowest. Which
SELECT statement clause is included in your query?
Mark for Review
(1) Points
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
The 25 greatest new balance values were displayed from the highest
to the lowest.
The statement failed to execute because the ORDER BY does NOT use
the Top-n column.
Section 11 Lesson 2
68. You need to retrieve the next available value for the
SALES_IDX sequence. Which would you include in your SQL statement? Mark
for Review
(1) Points
sales_idx
sales_idx.NEXT
sales_idx.NEXTVAL (*)
sales_idx.CURRVAL
Ensure primary key values will be unique even though gaps may exist
(*)
Correct Correct
True (*)
False
LOAD
MEMORY
CACHE (*)
NOCACHE
NOCYCLE
Section 11 Lesson 3
It allows only the user CHAN to access TESTING using the synonym.
It eliminates the need for all users to qualify TESTING with its
schema. (*)
Correct Correct
SELECT *
FROM employees
WHERE LOWER(last_name) = 'chang';
Mark for Review
(1) Points
A synonym.
A composite index.
You should create an index if the table is large and most queries
are expected to retrieve less than 2 to 4 percent of the rows. (*)
Correct Correct
SALARY
LAST_NAME
HIRE_DATE
EMPLOYEE_ID (*)
DEPARTMENT_ID
You want to create an index named ADDRESS_INDEX on the CITY and STATE
columns of the CLIENTS table. You issue this statement:
(*)
CREATE INDEX fl_idx ON employees(first_name);
CREATE INDEX fl_idx ON employees(last_name);
Correct Correct
A schema
An index
A view
A synonym (*)
Section 12 Lesson 2
UPDATE
INDEX
CREATE INDEX
ALTER TABLE
None; users do not need extra privileges to create indexes on
tables in their own schema (*)
SELECT (*)
DROP TABLE
CREATE TABLE
INSERT (*)
Section 12 Lesson 3
an index
a view
a trigger
a role (*)
PUBLIC
FORCE
ADMIN
ALL
PUBLIC (*)
USERS
Correct Correct
USER_TAB_PRIVS
USER_SYS_PRIVS (*)
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
Section 14 Lesson 1
A, B and C
A and B (*)
True (*)
False
Correct Correct
Correct Correct
You are a member of the SYSDBA role, but are not logged in as SYSDBA. You
issue this CREATE TABLE statement.
Which statement is true?
Mark for Review
(1) Points
Correct Correct
Correct Correct
Section 8 Lesson 2
Correct Correct
The CHAR data type requires that a minimum size be specified when
defining a column of this type. (*)
Correct Correct
DATE
DATETIME
TIMESTAMP (*)
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
CHAR
DATE (*)
TIMESTAMP
Correct Correct
DATE
TIMESTAMP
12. You are designing a table for the Sales department. You
need to include a column that contains each sales total. Which data type
should you specify for this column? Mark for Review
(1) Points
CHAR
DATE
NUMBER (*)
VARCHAR2
Section 8 Lesson 3
13. You need to remove all the data in the SCHEDULE table,
the structure of the table, and the indexes associated with the table.
Which statement should you use? Mark for Review
(1) Points
ALTER TABLE
DELETE TABLE
Correct Correct
When a character column contains data, you can decrease the width
of the column without any restrictions.
When a character column contains data, you can decrease the width
of the column if the existing data does not violate the new size. (*)
You cannot decrease the width of a character column unless the
table in which the column resides is empty.
Correct Correct
You need to remove the EMPLOYEE_ID column from the EMPLOYEES table. Which
statement could you use to accomplish this task?
Mark for Review
(1) Points
Correct Correct
20. Evaluate this statement:
Frees the disk space used by the data in the FAX column
Prevents a new FAX column from being added to the EMPLOYEES table
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
Which statement should you use to increase the LAST_NAME column length to
35 if the column currently contains 200 records?
Mark for Review
(1) Points
Correct Correct
22. 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 table structure. Which statement should you use? Mark for Review
(1) Points
DONATIONS:
PLEDGE_ID NUMBER
DONOR_ID NUMBER
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
You must drop and recreate the DONATIONS table to achieve these
results.
You must use the ADD OR REPLACE option to achieve these results.
Section 9 Lesson 1
Columns without the NOT NULL constraint can contain null values by
default.
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
NOT NULL constraints can only be specified at the column level. (*)
Correct Correct
FOREIGN KEY
UNIQUE
CHECK
Null Field
Table (*)
Row
Dictionary
Column (*)
Section 9 Lesson 2
8 (*)
RESEMBLES
ON DELETE CASCADE
REFERENTIAL
REFERENCES (*)
1. The table must contain the EMPLOYEE_ID and TASKED_HOURS columns for
numeric data.
2. The table must contain the START_DATE and END_DATE column for date
values.
3. The table must contain the HOURLY_RATE and PROJECT_COST columns for
numeric data with precision and scale of 5,2 and 10,2 respectively.
4. The table must have a composite primary key on the EMPLOYEE_ID and
START_DATE columns.
How many of the requirements does the CREATE TABLE statement satisfy?
Mark for Review
(1) Points
None of the four requirements
36. What must exist on the Parent table before Oracle will
allow you to create a FOREIGN KEY constraint from a Child table? Mark
for Review
(1) Points
Correct Correct
The PRIMARY KEY constraint must be defined at the table level. (*)
The PRIMARY KEY constraint must be defined for the first column of
the composite primary key.
The PRIMARY KEY constraint must be defined at the table level and
for each column in the composite primary key.
Section 9 Lesson 3
FOREIGN KEY
REFERENCES
CASCADE (*)
Correct Correct
ADD
CHANGE
MODIFY (*)
ENABLE
Correct Correct
PRODUCT
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
SUPPLIER
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:
DBA_CONSTRAINTS
USER_CONSTRAINTS (*)
ALL_CONS_COLUMNS
USER_CONS_COLUMNS
EMPLOYEE_ID NUMBER
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER
JOB_ID NUMBER
MANAGER_ID NUMBER
SALARY NUMBER(9,2)
HIRE_DATE DATE
The ALTER TABLE statement fails because the ADD CONSTRAINT clause
contains a syntax error. (*)
(*)
Section 10 Lesson 1
HAVING
WHERE
ORDER BY
49. You need to create a view that when queried will display
the name, employee identification number, first and last name, salary,
and department identification number. When queried, the display should be
sorted by salary from lowest to highest, then by last name and first name
alphabetically. The view definition should be created regardless of the
existence of the EMPLOYEES table. No DML may be performed when using this
view. Evaluate these statements:
SELECT *
FROM emp_salary_v
ORDER BY salary, last_name, first_name;
When both statements are executed all of the desired results are
achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not
exist. (*)
The statements will NOT return all of the desired results because
the WITH CHECK OPTION clause is NOT included in the CREATE VIEW
statement.
Correct Correct
FORCE (*)
NOFORCE
OR REPLACE
WITH READ ONLY
Correct Correct
You have been asked to compile a report that identifies all adjunct
professors who will be teaching classes in the upcoming term. You want to
create a view that will simplify the creation of this report. Which
CREATE VIEW statements will accomplish this task?
Mark for Review
(1) Points
CREATE VIEW
(SELECT first_name, last_name, status, courseid, subject, term
FROM faculty, course
WHERE facultyid = facultyid);
(*)
Views allow access to the data because the view displays all of the
columns from the table.
Views are used when you only want to restrict DML operations using
a WITH CHECK OPTION.
Views are not valid unless you have more than one user.
Correct Correct
53. Which option would you use to modify a view rather than
dropping it and recreating it? Mark for Review
(1) Points
FORCE
NOFORCE
You cannot update data in the EMPLOYEES table using the EMP_VIEW
view. (*)
You can update any data in the EMPLOYEES table using the EMP_VIEW
view.
You can delete records from the EMPLOYEES table using the EMP_VIEW
view.
You can update only the SALARY column in the EMPLOYEES table using
the EMP_VIEW view.
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still
returns the original data from those tables.
Section 10 Lesson 2
a WHERE clause
You can delete data in a view if the view contains the DISTINCT
keyword.
You cannot perform DML operations on a view that contains the WITH
CHECK OPTION clause.
You can perform DML operations on a view that contains the WITH
READ ONLY option.
To make sure no rows are updated through the view that will hinder
those rows from being returned by the view. (*)
They derive data from many tables, so they typically contain joins.
61. Your manager has just asked you to create a report that
illustrates the salary range of all the employees at your company. Which
of the following SQL statements will create a view called SALARY_VU based
on the employee last names, department names, salaries, and salary grades
for all employees? Use the EMPLOYEES, DEPARTMENTS, and JOB_GRADES tables.
Label the columns Employee, Department, Salary, and Grade, respectively.
Mark for Review
(1) Points
(*)
True (*)
False
Correct Correct
Section 10 Lesson 3
Correct Correct
You can modify data in the SALES table using the SALES_VIEW view.
You cannot modify data in the SALES table using the SALES_VIEW
view. (*)
You can only insert records into the SALES table using the
SALES_VIEW view.
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
You created a Top-n query report that displays the account numbers and
new balance of the 800 accounts that have the highest new balance value.
The results are sorted by payments value from highest to lowest. Which
SELECT statement clause is included in your query?
Mark for Review
(1) Points
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
You execute this statement:
The 25 greatest new balance values were displayed from the highest
to the lowest.
The statement failed to execute because the ORDER BY does NOT use
the Top-n column.
Section 11 Lesson 2
68. You need to retrieve the next available value for the
SALES_IDX sequence. Which would you include in your SQL statement? Mark
for Review
(1) Points
sales_idx
sales_idx.NEXT
sales_idx.NEXTVAL (*)
sales_idx.CURRVAL
Incorrect Incorrect. Refer to Section 11
Ensure primary key values will be unique even though gaps may exist
(*)
Correct Correct
True (*)
False
LOAD
MEMORY
CACHE (*)
NOCACHE
NOCYCLE
Section 11 Lesson 3
It allows only the user CHAN to access TESTING using the synonym.
It eliminates the need for all users to qualify TESTING with its
schema. (*)
Correct Correct
SELECT *
FROM employees
WHERE LOWER(last_name) = 'chang';
Mark for Review
(1) Points
A synonym.
A composite index.
Correct Correct
SALARY
LAST_NAME
HIRE_DATE
EMPLOYEE_ID (*)
DEPARTMENT_ID
You want to create an index named ADDRESS_INDEX on the CITY and STATE
columns of the CLIENTS table. You issue this statement:
(*)
Correct Correct
A schema
An index
A view
A synonym (*)
85. For which column would you create an index? Mark for
Review
(1) Points
Section 12 Lesson 2
UPDATE
INDEX
ALTER TABLE
SELECT (*)
DROP TABLE
CREATE TABLE
INSERT (*)
Section 12 Lesson 3
an index
a view
a trigger
a role (*)
PUBLIC
FORCE
ADMIN
ALL
PUBLIC (*)
USERS
Correct Correct
USER_SYS_PRIVS (*)
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
Section 14 Lesson 1
A, B and C
A and B (*)
False
Correct Correct
Section 8 Lesson 1
2001_PRODUCTS
PRODUCTS_2001 (*)
PRODUCTS_(2001)
PRODUCTS--2001
Correct Correct
4 (*)
Correct Correct
You are a member of the SYSDBA role, but are not logged in as SYSDBA. You
issue this CREATE TABLE statement.
Which statement is true?
Mark for Review
(1) Points
Correct Correct
Correct Correct
Section 8 Lesson 2
CHAR
DATE
NUMBER (*)
VARCHAR2
Correct Correct
LONG
NUMBER
BLOB (*)
LONGRAW
Correct Correct
DATETIME
TIMESTAMP
Correct Correct
DATE (*)
TIMESTAMP
Correct Correct
Section 8 Lesson 2
DATE
DATETIME
TIMESTAMP (*)
Correct Correct
Correct Correct
Section 8 Lesson 3
Which statement should you use to decrease the width of the FIRST_NAME
column to 10 if the column currently contains 1500 records, but none are
longer than 10 bytes or characters?
Mark for Review
(1) Points
Correct Correct
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
Which statement should you use to increase the LAST_NAME column length to
35 if the column currently contains 200 records?
Mark for Review
(1) Points
The column named COLOR in the table named PRODUCTS will be assigned
default values.
The column named COLOR in the table named PRODUCTS will be created.
The column named COLOR in the table named PRODUCTS will be deleted.
The column named COLOR in the table named PRODUCTS will not be
returned in subsequent reads of the table by Oracle, as is has been
deleted logically. (*)
Which statement will permanently remove all the data in the EMPLOYEES
table, but will retain the table's structure and storage space?
Mark for Review
(1) Points
The TEAMS table is currently empty. You need to allow users to include
text characters in the manager identification values. Which statement
should you use to implement this?
Mark for Review
(1) Points
18. 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 table structure. Which statement should you use? Mark for Review
(1) Points
Correct Correct
(*)
You can produce the same results by issuing the 'DELETE employees'
statement.
Section 8 Lesson 3
DONATIONS:
PLEDGE_ID NUMBER
DONOR_ID NUMBER
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
You must drop and recreate the DONATIONS table to achieve these
results.
You must use the ADD OR REPLACE option to achieve these results.
Correct Correct
22. 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
Correct Correct
You can modify the data type of a column if the column contains
non-null data. (*)
You can convert a CHAR data type column to the VARCHAR2 data type.
Section 9 Lesson 1
24. 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
Null Field
Table (*)
Row
Dictionary
Column (*)
Correct Correct
The NOT NULL constraint must be defined at the column level. (*)
The NOT NULL constraint can be defined at either the column level
or the table level.
28. A table can only have one unique key constraint defined.
True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct
29. You need to ensure that the LAST_NAME column does not
contain null values. Which type of constraint should you define on the
LAST_NAME column? Mark for Review
(1) Points
CHECK
UNIQUE
PRIMARY KEY
Section 9 Lesson 2
A FOREIGN KEY column can have a different data type from the
primary key column that it references.
Section 9 Lesson 2
31. When creating a referential constraint, which keyword(s)
identifies the table and column in the parent table? Mark for Review
(1) Points
FOREIGN KEY
REFERENCES (*)
ON DELETE CASCADE
The PRIMARY KEY constraint must be defined at the table level. (*)
The PRIMARY KEY constraint must be defined for the first column of
the composite primary key.
The PRIMARY KEY constraint must be defined at the table level and
for each column in the composite primary key.
Correct Correct
Correct Correct
Correct Correct
FOREIGN KEY
UNIQUE
CHECK
36. Which clause could you use to ensure that cost values
are greater than 1.00? Mark for Review
(1) Points
Correct Correct
DONATIONS
PLEDGE_ID NUMBER NOT NULL, Primary Key
DONOR_ID NUMBER Foreign key to DONOR_ID column of DONORS table
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
Which CREATE TABLE statement should you use to create the DONATIONS
table?
Mark for Review
(1) Points
(*)
Section 9 Lesson 3
Correct Correct
39. You disabled the EMPLOYEE_ID_PK PRIMARY KEY constraint
on the ID column in the EMPLOYEES table and imported 100 records. You
need to enable the constraint and verify that the new and existing ID
column values do not violate the PRIMARY KEY constraint. Evaluate this
statement:
The statement will execute, but will ensure that the new ID values
are unique.
The statement will execute, but will not verify that the existing
values are unique.
(*)
Section 9 Lesson 3
Correct Correct
Correct Correct
Correct Correct
(*)
Correct Correct
47. 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 (*)
ENABLE
Section 10 Lesson 1
48. You need to create a view on the SALES table, but the
SALES table has not yet been created. Which statement is true? Mark
for Review
(1) Points
You must create the SALES table before creating the view.
By default, the view will be created even if the SALES table does
not exist.
You can create the table and the view at the same time using the
FORCE option.
You can use the FORCE option to create the view before the SALES
table has been created. (*)
49. You need to create a view that when queried will display
the name, employee identification number, first and last name, salary,
and department identification number. When queried, the display should be
sorted by salary from lowest to highest, then by last name and first name
alphabetically. The view definition should be created regardless of the
existence of the EMPLOYEES table. No DML may be performed when using this
view. Evaluate these statements:
SELECT *
FROM emp_salary_v
ORDER BY salary, last_name, first_name;
When both statements are executed all of the desired results are
achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not
exist. (*)
The statements will NOT return all of the desired results because
the WITH CHECK OPTION clause is NOT included in the CREATE VIEW
statement.
Correct Correct
HAVING
WHERE
ORDER BY
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still
returns the original data from those tables.
Correct Correct
True
False (*)
Create an index.
Which of the following statements using the PART_NAME_V view will execute
successfully?
Mark for Review
(1) Points
SELECT *
FROM part_name_v;
(*)
UPDATE part_name_v
SET cost = cost * 1.23
WHERE part_id = 56990;
MODIFY VIEW
ALTER TABLE
Correct Correct
Section 10 Lesson 2
They derive data from many tables, so they typically contain joins.
Correct Correct
Correct Correct
Disabling an index
Altering a table
True (*)
False
Correct Correct
60. Your manager has just asked you to create a report that
illustrates the salary range of all the employees at your company. Which
of the following SQL statements will create a view called SALARY_VU based
on the employee last names, department names, salaries, and salary grades
for all employees? Use the EMPLOYEES, DEPARTMENTS, and JOB_GRADES tables.
Label the columns Employee, Department, Salary, and Grade, respectively.
Mark for Review
(1) Points
CREATE OR REPLACE VIEW salary_vu
AS SELECT e.last_name "Employee", d.department_name "Department",
e.salary "Salary", j.grade_level "Grade"
FROM employees e, departments d, job_grades
WHERE e.department_id equals d.department_id AND e.salary BETWEEN
j.lowest_sal and j.highest_sal;
(*)
Section 10 Lesson 2
FORCE
NOFORCE
You cannot perform DML operations on a view that contains the WITH
CHECK OPTION clause.
You can perform DML operations on a view that contains the WITH
READ ONLY option.
Correct Correct
Section 10 Lesson 3
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
The 25 greatest new balance values were displayed from the highest
to the lowest.
The statement failed to execute because the ORDER BY does NOT use
the Top-n column.
Correct Correct
CUSTOMER_ID NUMBER(9)
NEW_BALANCE NUMBER(7,2)
PREV_BALANCE NUMBER(7,2)
PAYMENTS NUMBER(7,2)
FINANCE_CHARGE NUMBER(7,2)
CREDIT_LIMIT NUMBER(7)
You created a Top-n query report that displays the account numbers and
new balance of the 800 accounts that have the highest new balance value.
The results are sorted by payments value from highest to lowest. Which
SELECT statement clause is included in your query?
Mark for Review
(1) Points
Correct Correct
Which SELECT statement could be used to display the 10 lowest paid clerks
that belong to department 70?
Mark for Review
(1) Points
(*)
the AS keyword
a WHERE clause
the IN keyword
A top-N query returns the top 15 records from the specified table.
Correct Correct
Section 11 Lesson 2
68. Which statement would you use to remove the EMP_ID_SEQ
sequence? Mark for Review
(1) Points
NEXTVAL
CURRVAL (*)
CURRENT
NEXT
Correct Correct
Section 11 Lesson 2
71. You need to retrieve the next available value for the
SALES_IDX sequence. Which would you include in your SQL statement? Mark
for Review
(1) Points
sales_idx
sales_idx.NEXT
sales_idx.NEXTVAL (*)
sales_idx.CURRVAL
Correct Correct
True
False (*)
Section 11 Lesson 3
73. You need to determine the table name and column name(s)
on which the SALES_IDX index is defined. Which data dictionary view would
you query? Mark for Review
(1) Points
USER_INDEXES
USER_TABLES
USER_OBJECTS
USER_IND_COLUMNS (*)
74.
Correct Correct
(*)
CREATE SYNONYM cust
ON mary.customers FOR PUBLIC;
Correct Correct
SALARY
LAST_NAME
HIRE_DATE
EMPLOYEE_ID (*)
DEPARTMENT_ID
Correct Correct
User Susan now needs to SELECT from Mary's EMPLOYEES table. Which of the
following SQL statements can she use? (Choose two)
Mark for Review
(1) Points
Correct Correct
It allows only the user CHAN to access TESTING using the synonym.
It eliminates the need for all users to qualify TESTING with its
schema. (*)
Section 11 Lesson 3
You want to create an index named ADDRESS_INDEX on the CITY and STATE
columns of the CLIENTS table. You issue this statement:
Correct Correct
Correct Correct
83. Evaluate this statement:
Correct Correct
An index can run statement blocks when DML actions occur against a
table.
Correct Correct
Section 12 Lesson 2
86. You grant user AMY the CREATE SESSION privilege. Which
type of privilege have you granted to AMY? Mark for Review
(1) Points
An object privilege
A user privilege
An access privilege
Correct Correct
(*)
SELECT (*)
DROP TABLE
CREATE TABLE
INSERT (*)
Correct Correct
Correct
Section 12 Lesson 2
91. You want to grant user BOB the ability to change other
users' passwords. Which privilege should you grant to BOB? Mark for
Review
(1) Points
Correct Correct
92. The database administrator wants to allow user Marco to
create new tables in his own schema. Which privilege should be granted to
Marco? Mark for Review
(1) Points
SELECT
CREATE OBJECT
Correct Correct
Section 12 Lesson 3
It allows a user's session to read from the table but only so that
foreign key constraints can be checked. (*)
It allows the user to create new tables which contain the same data
as the referenced table.
ALL
PUBLIC (*)
USERS
Correct Correct
GRANT (*)
ALTER USER
CREATE USER
ASSIGN
an index
a view
a trigger
a role (*)
Correct Correct
USER_TAB_PRIVS
USER_SYS_PRIVS (*)
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
Correct Correct
CREATE ROLE
ALTER ROLE
GRANT (*)
ASSIGN
Correct Correct
Section 14 Lesson 1
ROLLBACK; (*)
ROLLBACK TO SAVEPOINT;
REVOKE …;
Correct Correct
It prevents users from querying tables on which they have not been
granted SELECT privilege
Se ignorã elementele de navigare în conþinutul paginii
Test: Final Exam - Database Programming with SQL
Review your answers, feedback, and question scores below. An asterisk (*)
indicates a correct answer.
Section 8 Lesson 1
You are a member of the SYSDBA role, but are not logged in as SYSDBA. You
issue this CREATE TABLE statement.
Which statement is true?
Mark for Review
(1) Points
Correct Correct
Correct Correct
1NUMBER
NUMBER
NUMBER_1$ (*)
1_NUMBER#
Correct Correct
Correct Correct
Section 8 Lesson 2
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
Correct Correct
DATETIME
TIMESTAMP
INTERVAL YEAR TO MONTH
Correct Correct
Correct Correct
DATE
DATETIME
TIMESTAMP (*)
Correct Correct
10. You need to store the SEASONAL data in months and years.
Which data type should you use? Mark for Review
(1) Points
DATE
TIMESTAMP
Correct Correct
LONG
NUMBER
BLOB (*)
LONGRAW
Correct Correct
12. 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? Mark for Review
(1) Points
DATETIME
TIMESTAMP
Correct Correct
Section 8 Lesson 3
The column named COLOR in the table named PRODUCTS will be assigned
default values.
The column named COLOR in the table named PRODUCTS will be created.
The column named COLOR in the table named PRODUCTS will be deleted.
The column named COLOR in the table named PRODUCTS will not be
returned in subsequent reads of the table by Oracle, as is has been
deleted logically. (*)
Correct Correct
14. 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 table structure. Which statement should you use? Mark for Review
(1) Points
Correct Correct
Which statement will permanently remove all the data in the EMPLOYEES
table, but will retain the table's structure and storage space?
Mark for Review
(1) Points
Frees the disk space used by the data in the FAX column
Prevents a new FAX column from being added to the EMPLOYEES table
Correct Correct
You need to remove the EMPLOYEE_ID column from the EMPLOYEES table. Which
statement could you use to accomplish this task?
Mark for Review
(1) Points
Correct Correct
You can produce the same results by issuing the 'DROP TABLE
employees' statement.
You can produce the same results by issuing the 'DELETE employees'
statement.
19. 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
Correct Correct
Which statement should you use to decrease the width of the FIRST_NAME
column to 10 if the column currently contains 1500 records, but none are
longer than 10 bytes or characters?
Mark for Review
(1) Points
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
You CANNOT modify the data type of the EMPLOYEE_ID column, as the
table is not empty. (*)
You can convert a CHAR data type column to the VARCHAR2 data type.
Correct Correct
Section 9 Lesson 1
24. A table can only have one unique key constraint defined.
True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct
Null Field
Table (*)
Row
Dictionary
Column (*)
Correct Correct
26. 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
NOT NULL constraints can only be specified at the column level. (*)
Correct Correct
Columns without the NOT NULL constraint can contain null values by
default.
Correct Correct
29. 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
Section 9 Lesson 2
8 (*)
Correct Correct
The PRIMARY KEY constraint must be defined at the table level. (*)
The PRIMARY KEY constraint must be defined for the first column of
the composite primary key.
The PRIMARY KEY constraint must be defined at the table level and
for each column in the composite primary key.
Correct Correct
FOREIGN KEY
UNIQUE
CHECK
Correct Correct
33. How many PRIMARY KEY constraints can be created for each
table? Mark for Review
(1) Points
none
one or two
unlimited
DONATIONS
PLEDGE_ID NUMBER NOT NULL, Primary Key
DONOR_ID NUMBER Foreign key to DONOR_ID column of DONORS table
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
Which CREATE TABLE statement should you use to create the DONATIONS
table?
Mark for Review
(1) Points
(*)
Correct Correct
FOREIGN KEY
REFERENCES (*)
ON DELETE CASCADE
Correct Correct
36. Which clause could you use to ensure that cost values
are greater than 1.00? Mark for Review
(1) Points
Section 9 Lesson 3
(*)
Correct Correct
FOREIGN KEY
REFERENCES
CASCADE (*)
Correct Correct
Correct Correct
To disable the PRIMARY KEY and any FOREIGN KEY constraints that are
dependent on the PO_NUM column (*)
Correct Correct
Correct Correct
43. 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 (*)
ENABLE
Correct Correct
(*)
Correct Correct
Correct Correct
Correct Correct
DBA_CONSTRAINTS
USER_CONSTRAINTS (*)
ALL_CONS_COLUMNS
USER_CONS_COLUMNS
Correct Correct
Section 10 Lesson 1
48. Which option would you use to modify a view rather than
dropping it and recreating it? Mark for Review
(1) Points
FORCE
NOFORCE
Correct Correct
Views allow access to the data because the view displays all of the
columns from the table.
Views are used when you only want to restrict DML operations using
a WITH CHECK OPTION.
Views are not valid unless you have more than one user.
Correct Correct
50. You need to create a view that when queried will display
the name, employee identification number, first and last name, salary,
and department identification number. When queried, the display should be
sorted by salary from lowest to highest, then by last name and first name
alphabetically. The view definition should be created regardless of the
existence of the EMPLOYEES table. No DML may be performed when using this
view. Evaluate these statements:
SELECT *
FROM emp_salary_v
ORDER BY salary, last_name, first_name;
When both statements are executed all of the desired results are
achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not
exist. (*)
The statements will NOT return all of the desired results because
the WITH CHECK OPTION clause is NOT included in the CREATE VIEW
statement.
Correct Correct
51. You need to create a view on the SALES table, but the
SALES table has not yet been created. Which statement is true? Mark
for Review
(1) Points
You must create the SALES table before creating the view.
By default, the view will be created even if the SALES table does
not exist.
You can create the table and the view at the same time using the
FORCE option.
You can use the FORCE option to create the view before the SALES
table has been created. (*)
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still
returns the original data from those tables.
Correct Correct
53. Which keyword(s) would you include in a CREATE VIEW
statement to create the view regardless of whether or not the base table
exists? Mark for Review
(1) Points
FORCE (*)
NOFORCE
OR REPLACE
Correct Correct
Which of the following statements using the PART_NAME_V view will execute
successfully?
Mark for Review
(1) Points
SELECT *
FROM part_name_v;
(*)
UPDATE part_name_v
SET cost = cost * 1.23
WHERE part_id = 56990;
Section 10 Lesson 2
(*)
Correct Correct
FORCE
NOFORCE
a WHERE clause
Correct Correct
a WHERE clause
a join
a column alias
Correct Correct
True (*)
False
Correct Correct
FORCE
OR REPLACE
Section 10 Lesson 3
Correct Correct
EMPLOYEE_ID NUMBER
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER
JOB_ID NUMBER
MANAGER_ID NUMBER
SALARY NUMBER(9,2)
COMMISSOIN NUMBER(7,2)
HIRE_DATE DATE
Which SELECT statement could be used to display the 10 lowest paid clerks
that belong to department 70?
Mark for Review
(1) Points
(*)
Correct Correct
DROP emp_hist_v;
DELETE emp_hist_v;
REMOVE emp_hist_v;
Correct Correct
66. You must create a view that when queried will display
the name, customer identification number, new balance, finance charge and
credit limit of all customers. You issue this statement:
UPDATE
DELETE
INSERT
SELECT (*)
Correct Correct
the AS keyword
a WHERE clause
the IN keyword
Correct Correct
Section 11 Lesson 2
68. What is the most common use for a Sequence? Mark for
Review
(1) Points
69. The ALTER SEQUENCE statement can be used to: Mark for
Review
(1) Points
Change the maximum value to a lower number than was last used
Correct Correct
Correct Correct
Section 11 Lesson 3
a CHECK constraint
an index (*)
(*)
Correct Correct
Correct Correct
76. What would you create to make the following statement
execute faster?
SELECT *
FROM employees
WHERE LOWER(last_name) = 'chang';
Mark for Review
(1) Points
A synonym.
A composite index.
Correct Correct
User Susan now needs to SELECT from Mary's EMPLOYEES table. Which of the
following SQL statements can she use? (Choose two)
Mark for Review
(1) Points
Correct Correct
78. When creating an index on a table, which of the
following statements are true? (Choose two) Mark for Review
(1) Points
You should create an index if the table is large and most queries
are expected to retrieve less than 2 to 4 percent of the rows. (*)
Correct Correct
(*)
Correct Correct
80. The CLIENTS table contains these columns:
You want to create an index named ADDRESS_INDEX on the CITY and STATE
columns of the CLIENTS table. You issue this statement:
Correct Correct
Correct Correct
83. You need to determine the table name and column name(s)
on which the SALES_IDX index is defined. Which data dictionary view would
you query? Mark for Review
(1) Points
USER_INDEXES
USER_TABLES
USER_OBJECTS
USER_IND_COLUMNS (*)
Correct Correct
84. For which column would you create an index? Mark for
Review
(1) Points
Correct Correct
Correct Correct
Section 12 Lesson 2
86. You want to grant user BOB the ability to change other
users' passwords. Which privilege should you grant to BOB? Mark for
Review
(1) Points
Correct Correct
ALTER SESSION
OPEN SESSION
START SESSION
Correct Correct
88. Which of the following are object privileges? (Choose
two) Mark for Review
(1) Points
SELECT (*)
DROP TABLE
CREATE TABLE
INSERT (*)
Correct Correct
89. You grant user AMY the CREATE SESSION privilege. Which
type of privilege have you granted to AMY? Mark for Review
(1) Points
An object privilege
A user privilege
An access privilege
Correct Correct
(*)
Correct Correct
UPDATE
INDEX
Correct Correct
92. User JAMES has created a CUSTOMERS table and wants to
allow all other users to SELECT from it. Which command should JAMES use
to do this? Mark for Review
(1) Points
Correct Correct
Section 12 Lesson 3
GRANT (*)
ALTER USER
CREATE USER
ASSIGN
Correct Correct
an index
a view
a trigger
a role (*)
Correct Correct
Correct Correct
USER_TAB_PRIVS
USER_SYS_PRIVS (*)
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
Correct Correct
True
False (*)
Correct Correct
ADMIN
ALL
PUBLIC (*)
USERS
Correct Correct
Section 14 Lesson 1
You want to retain all the employees with a salary of 15000; What
statement would you execute next?
Mark for Review
(1) Points
ROLLBACK;
There is nothing you can do, either all changes must be rolled
back, or none of them can be rolled back.
Correct Correct
A, B and C
A and B (*)
Which statement will permanently remove all the data in the EMPLOYEES table, but will retain the table's structure and storage space?
Mark for Review
(1) Points
ALTER TABLE employees SET UNUSED (employee_id, last_name, first_name, department_id, salary);
2. Which statement about decreasing the width of a column is true? Mark for Review
(1) Points
When a character column contains data, you cannot decrease the width of the column.
When a character column contains data, you can decrease the width of the column without any restrictions.
When a character column contains data, you can decrease the width of the column if the existing data does not violate the new size. (*)
You cannot decrease the width of a character column unless the table in which the column resides is empty.
Frees the disk space used by the data in the FAX column
Prevents data in the FAX column from being displayed, by performing a logical drop of the column. (*)
Prevents a new FAX column from being added to the EMPLOYEES table
You can modify the data type of a column if the column contains non-null data. (*)
You can convert a CHAR data type column to the VARCHAR2 data type.
Which statement should you use to decrease the width of the FIRST_NAME column to 10 if the column currently contains 1500 records, but none are longer than 10
bytes or characters?
Mark for Review
(1) Points
6. To do a logical delete of a column without the performance penalty of rewriting all the table datablocks you can issue the following command: Mark for Review
(1) Points
7. The previous administrator created a table named CONTACTS, which contains outdated data. You want to remove the table and its data from the database. Which
statement should you issue? Mark for Review
(1) Points
DELETE
TRUNCATE TABLE
ALTER TABLE
8. You want to issue the following command on a database that includes your company's inventory information:
ALTER TABLE products SET UNUSED COLUMN color;
What will be the result of issuing this command?
Mark for Review
(1) Points
The column named COLOR in the table named PRODUCTS will be assigned default values.
The column named COLOR in the table named PRODUCTS will be created.
The column named COLOR in the table named PRODUCTS will be deleted.
The column named COLOR in the table named PRODUCTS will not be returned in subsequent reads of the table by Oracle, as is has been deleted logically. (*)
Incorrect. Refer to Section 8 Lesson 3
9. Your supervisor has asked you to modify the AMOUNT column in the ORDERS table. He wants the column to be configured to accept a default value of 250. The
table constains data that you need to keep. Which statement should you issue to accomplish this task? Mark for Review
(1) Points
You need to reduce the precision of the AMOUNT_PLEDGED column to 5 with a scale of 2 and ensure that when inserting a row into the DONATIONS table
without a value for the AMOUNT_PLEDGED column, a price of $10.00 will automatically be inserted. The DONATIONS table currently contains NO records.
Which statement is true?
Mark for Review
(1) Points
Both changes can be accomplished with one ALTER TABLE statement. (*)
You must drop and recreate the DONATIONS table to achieve these results.
You must use the ADD OR REPLACE option to achieve these results.
12. Which data types stores variable-length character data? Select two. Mark for Review
(1) Points
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
Data stored in the column will be returned in the database's local time zone. (*)
14. A column that will be used to store binary data up to 4 Gigabyes in size should be defined as which datatype? Mark for Review
(1) Points
LONG
NUMBER
BLOB (*)
LONGRAW
15. The TIMESTAMP data type allows what? Mark for Review
(1) Points
Zero
Two
Four (*)
Six
17. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this
column? Mark for Review
(1) Points
CHAR
DATE
NUMBER (*)
VARCHAR2
18. To store time with fractions of seconds, which datatype should be used for a table column? Mark for Review
(1) Points
DATE
TIMESTAMP (*)
1NUMBER
NUMBER
NUMBER_1$ (*)
1_NUMBER#
20. You want to create a database table that will contain information regarding products that your company released during 2001. Which name can you assign to the
table that you create? Mark for Review
(1) Points
2001_PRODUCTS
PRODUCTS_2001 (*)
PRODUCTS_(2001)
PRODUCTS--2001
4 (*)
22. Which CREATE TABLE statement will fail? Mark for Review
(1) Points
23. You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue? Mark for Review
(1) Points
Section 9
24. 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 (*)
25. Which constraint can only be created at the column level? Mark for Review
(1) Points
FOREIGN KEY
UNIQUE
CHECK
NOT NULL constraints can only be specified at the column level. (*)
27. You need to ensure that the LAST_NAME column does not contain null values. Which type of constraint should you define on the LAST_NAME column? Mark
for Review
(1) Points
CHECK
UNIQUE
PRIMARY KEY
28. 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
29. 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);
30. What is the highest number of NOT NULL constraints you can have on a table? Mark for Review
(1) Points
10
You can have as many NOT NULL constraints as you have columns in your table. (*)
31. What is an attribute of data that is entered into a primary key column? Mark for Review
(1) Points
Null and non-unique values cannot be entered into a primary key column. (*)
Data that is entered into a primary key column automatically increments by a value of 1 each time a new record is entered into the table.
Data that is entered into a primary key column references a column of the same datatype in another table.
Data that is entered into a primary key column is restricted to a range of numbers that is defined by the local Oracle database.
32. Which statement about a non-mandatory foreign key constraint is true? Mark for Review
(1) Points
A foreign key value must match an existing value in the parent table.
A foreign key value must either be null or match an existing value in the parent table. (*)
33. Which clause could you use to ensure that cost values are greater than 1.00? Mark for Review
(1) Points
34. Which of the following best describes the function of a CHECK constraint? Mark for Review
(1) Points
A CHECK constraint defines restrictions on the values that can be entered in a column or combination of columns. (*)
A CHECK constraint enforces uniqueness of the values that can be entered in a column or combination of columns.
35. When creating a referential constraint, which keyword(s) identifies the table and column in the parent table? Mark for Review
(1) Points
FOREIGN KEY
REFERENCES (*)
ON DELETE CASCADE
36. Which statement about a FOREIGN KEY constraint is true? Mark for Review
(1) Points
A FOREIGN KEY constraint requires the constrained column to contain values that exist in the referenced Primary or Unique key column of the parent table. (*)
A FOREIGN KEY constraint allows that a list of allowed values be checked before a value can be added to the constrained column.
A FOREIGN KEY column can have a different data type from the primary key column that it references.
37. Which of the following types of constraints enforces uniqueness? Mark for Review
(1) Points
CHECK
FOREIGN KEY
NOT NULL
8 (*)
Which CREATE TABLE statement should you use to create the DONATIONS table?
Mark for Review
(1) Points
Add a FOREIGN KEY constraint to the EMPLOYEES table restricting manager ID to match every employee ID.
Alter table employees and add a FOREIGN KEY constraint that indicates each employee ID must be unique.
42. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints? Mark for Review
(1) Points
To activate a new constraint while preventing the creation of a PRIMARY KEY index
To activate the previously disabled constraint on the EMPLOYEE_ID column while creating a PRIMARY KEY index (*)
44. You need to add a PRIMARY KEY constraint on the EMP_ID column of the EMPLOYEES table. Which ALTER TABLE statement should you use? Mark for
Review
(1) Points
ALTER TABLE employees
ADD CONSTRAINT PRIMARY KEY (emp_id);
(*)
ALTER TABLE
ADD CONSTRAINT emp_emp_id_pk PRIMARY KEY employees(emp_id);
45. What actions can be performed on or with Constraints? Mark for Review
(1) Points
46. You successfully create a table named SALARY in your company's database. Now, you want to establish a parent/child relationship between the EMPLOYEES
table and the SALARY table by adding a FOREIGN KEY constraint to the SALARY table that references its matching column in the EMPLOYEES table. You have
not added any data to the SALARY table. Which of the following statements should you issue? Mark for Review
(1) Points
The ALTER TABLE statement creates a referential constraint from the EMPLOYEES table to the DEPARTMENTS table.
The ALTER TABLE statement creates a referential constraint from the DEPARTMENTS table to the EMPLOYEES table.
The ALTER TABLE statement fails because the ADD CONSTRAINT clause contains a syntax error. (*)
The ALTER TABLE statement succeeds, but does NOT recreate a referential constraint.
48. When dropping a constraint, which keyword(s) specifies that all the referential integrity constraints that refer to the primary and unique keys defined on the dropped
columns are dropped as well? Mark for Review
(1) Points
FOREIGN KEY
REFERENCES
CASCADE (*)
To drop and recreate the PRIMARY KEY constraint on the PO_NUM column
To disable the PRIMARY KEY and any FOREIGN KEY constraints that are dependent on the PO_NUM column (*)
To disable the constraint on the PO_NUM column while creating a PRIMARY KEY index
50. You need to remove the EMP_FK_DEPT constraint from the EMPLOYEES table in your schema. Which statement should you use? Mark for Review
(1) Points
FORCE
NOFORCE
2. For a View created using the WITH CHECK OPTION keywords, which of the following statements are true? Mark for Review
(1) Points
The view will allow the user to check it against the data dictionary
Prohibits changing rows not returned by the subquery in the view definition. (*)
Allows for DELETES from other tables, including ones not listed in subquery
3. You can create a view if the view subquery contains an inline view. True or False? Mark for Review
(1) Points
True (*)
False
4. What is the purpose of including the WITH CHECK OPTION clause when creating a view? Mark for Review
(1) Points
To make sure no rows are updated through the view that will hinder those rows from being returned by the view. (*)
5. Which statement about performing DML operations on a view is true? Mark for Review
(1) Points
You cannot perform DML operations on a view that contains the WITH CHECK OPTION clause.
You can perform DML operations on a view that contains the WITH READ ONLY option.
You can perform DML operations on a view that contains columns defined by expressions, such as COST + 1.
6. Which action can be performed by using DML statements? Mark for Review
(1) Points
Deleting records in a table (*)
Disabling an index
Altering a table
7. You need to create a new view on the EMPLOYEES table to update salary information for employees in Department 50. You need to ensure that DML operations
through the view do not change the result set of the view. Which clause should include in the CREATE VIEW statement? Mark for Review
(1) Points
FORCE
OR REPLACE
8. You administer an Oracle database, which contains a table named EMPLOYEES. Luke, a database user, must create a report that includes the names and
addresses of all employees. You do not want to grant Luke access to the EMPLOYEES table because it contains sensitive data. Which of the following actions should
you perform first? Mark for Review
(1) Points
Create a subquery.
Create an index.
9. You need to create a view on the SALES table, but the SALES table has not yet been created. Which statement is true? Mark for Review
(1) Points
You must create the SALES table before creating the view.
By default, the view will be created even if the SALES table does not exist.
You can create the table and the view at the same time using the FORCE option.
You can use the FORCE option to create the view before the SALES table has been created. (*)
10. In order to query a database using a view, which of the following statements applies? Mark for Review
(1) Points
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still returns the original data from those tables.
11. You need to create a view that when queried will display the name, employee identification number, first and last name, salary, and department identification
number. When queried, the display should be sorted by salary from lowest to highest, then by last name and first name alphabetically. The view definition should be
number. When queried, the display should be sorted by salary from lowest to highest, then by last name and first name alphabetically. The view definition should be
created regardless of the existence of the EMPLOYEES table. No DML may be performed when using this view. Evaluate these statements:
CREATE OR REPLACE NOFORCE VIEW EMP_SALARY_V
AS SELECT employee_id, last_name, first_name, salary, department_id
FROM employees WITH READ ONLY;
SELECT *
FROM emp_salary_v
ORDER BY salary, last_name, first_name;
When both statements are executed all of the desired results are achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not exist. (*)
The statements will NOT return all of the desired results because the WITH CHECK OPTION clause is NOT included in the CREATE VIEW statement.
To achieve all of the desired results this ORDER ON clause should be added to the CREATE VIEW statement: 'ORDER ON salary, last_name, first_name'
Nested
Simple
Inline
Complex (*)
13. Which keyword(s) would you include in a CREATE VIEW statement to create the view regardless of whether or not the base table exists? Mark for Review
(1) Points
FORCE (*)
NOFORCE
OR REPLACE
14. Which of the following keywords cannot be used when creating a view? Mark for Review
(1) Points
HAVING
WHERE
ORDER BY
Which of the following statements using the PART_NAME_V view will execute successfully?
Mark for Review
(1) Points
SELECT *
FROM part_name_v;
(*)
UPDATE part_name_v
SET cost = cost * 1.23
WHERE part_id = 56990;
You created a Top-n query report that displays the account numbers and new balance of the 800 accounts that have the highest new balance value. The results are
sorted by payments value from highest to lowest. Which SELECT statement clause is included in your query?
Mark for Review
(1) Points
The statement will not necessarily return the 25 highest new balance values, as the inline view has no ORDER BY. (*)
The 25 greatest new balance values were displayed from the highest to the lowest.
The statement failed to execute because the ORDER BY does NOT use the Top-n column.
18. Which of the following describes a top-N query? Mark for Review
(1) Points
A top-N query returns the bottom 15 records from the specified table.
A top-N query returns the top 15 records from the specified table.
A top-N query returns a result set that is sorted according to the specified column values.
A top-N query returns a limited result set, returning data based on highest or lowest criteria. (*)
Which SELECT statement could be used to display the 10 lowest paid clerks that belong to department 70?
Mark for Review
(1) Points
An inline view is a subquery in the FROM clause, often named with an alias. (*)
The sequence will reuse numbers and will start with 101. (*)
The sequence will generate sequence numbers starting with 101, but will not reuse numbers.
22. When creating a sequence, which keyword or option specifies the minimum sequence value? Mark for Review
(1) Points
MAXVALUE
MINVALUE (*)
NOMAXVALUE
CYCLE
The sequence cannot generate additional values after reaching its maximum value.
The sequence will continue to generate values after the maximum sequence value has been generated. (*)
24. Which of the following best describes the function of the CURRVAL virtual column? Mark for Review
(1) Points
The CURRVAL virtual column will display the integer that was most recently supplied by a sequence. (*)
The CURRVAL virtual column will return a value of 1 for a parent record in a hierarchical result set.
25. When used in a CREATE SEQUENCE statement, which keyword specifies that a range of sequence values will be preloaded into memory? Mark for Review
(1) Points
LOAD
MEMORY
CACHE (*)
NOCACHE
NOCYCLE
27. You want to create a composite index on the FIRST_NAME and LAST_NAME columns of the EMPLOYEES table. Which SQL statement will accomplish this
task? Mark for Review
(1) Points
28. What is the correct syntax for creating a private synonym d_sum for the view DEPT_SUM_VU? Mark for Review
(1) Points
29. You create a table named CUSTOMERS and define a PRIMARY KEY constraint on the CUST_ID column. Which actions occur automatically? Mark for
Review
(1) Points
A trigger is created that will prevent NULL values from being accepted in the CUST_ID column.
A unique index is created on the CUST_ID column, if one does not already exist. (*)
A sequence is created that will generate a unique value in the CUST_ID column for each row that is inserted into the CUSTOMERS table.
You created a public synonym on the EMP table owned by user Sam.
You created a private synonym on the EMPLOYEES table that you own.
You created a public synonym on the EMPLOYEES table owned by user Sam.
You created a private synonym on the EMPLOYEES table owned by user Sam. (*)
31. User Mary's schema contains an EMPLOYEES table. Mary has Database Administrator privileges and executes the following statement:
CREATE PUBLIC SYNONYM employees FOR mary.employees;
User Susan now needs to SELECT from Mary's EMPLOYEES table. Which of the following SQL statements can she use? (Choose two)
Mark for Review
(1) Points
32. Which statement would you use to remove the LAST_NAME_IDX index on the LAST_NAME column of the EMPLOYEES table? Mark for Review
(1) Points
33. For which column would you create an index? Mark for Review
(1) Points
EMP_ID only
JOB_ID only
DEPT_ID only
You want to create an index named ADDRESS_INDEX on the CITY and STATE columns of the CLIENTS table. You execute this statement:
Section 12
37. Which of the following best describes a role in an Oracle database? Mark for Review
(1) Points
38. User SUSAN creates an EMPLOYEES table, and then creates a view EMP_VIEW which shows only the FIRST_NAME and LAST_NAME columns of
EMPLOYEES. User RUDI needs to be able to access employees' names but no other data from EMPLOYEES. Which statement should SUSAN execute to allow
this? Mark for Review
(1) Points
39. User JAMES has created a CUSTOMERS table and wants to allow all other users to SELECT from it. Which command should JAMES use to do this? Mark for
Review
(1) Points
40. Which of the following privileges must be assigned to a user account in order for that user to connect to an Oracle database? Mark for Review
(1) Points
ALTER SESSION
OPEN SESSION
RESTRICTED SESSION
41. You grant user AMY the CREATE SESSION privilege. Which type of privilege have you granted to AMY? Mark for Review
(1) Points
An object privilege
A user privilege
An access privilege
42. User CHANG has been granted SELECT, UPDATE, INSERT and DELETE privileges on the EMPLOYEES table. You now want to prevent Chang from
adding or deleting rows from the table, while still allowing him to read and modify existing rows. Which statement should you use to do this? Mark for Review
(1) Points
43. Which statement would you use to grant a role to users? Mark for Review
(1) Points
GRANT (*)
ALTER USER
CREATE USER
ASSIGN
44. Which of the following best describes the purpose of the REFERENCES object privilege on a table? Mark for Review
(1) Points
It allows a user's session to read from the table but only so that foreign key constraints can be checked. (*)
It allows the user to create new tables which contain the same data as the referenced table.
45. Which statement would you use to add privileges to a role? Mark for Review
(1) Points
CREATE ROLE
ALTER ROLE
GRANT (*)
ASSIGN
46. Which statement would you use to remove an object privilege granted to a user? Mark for Review
(1) Points
ALTER USER
REVOKE (*)
REMOVE
DROP
47. Which keyword would you use to grant an object privilege to all database users? Mark for Review
(1) Points
ADMIN
ALL
PUBLIC (*)
USERS
48. Granting an object privilege WITH GRANT OPTION allows the recipient to grant other object privileges on the table to other users. Mark for Review
(1) Points
True
False (*)
Section 14
You want to retain all the employees with a salary of 15000; What statement would you execute next?
Mark for Review
(1) Points
ROLLBACK;
50. If a database crashes, all uncommitted changes are automatically rolled back. True or False? Mark for Review
(1) Points
True (*)
False
The BFILE data type stores character data up to four gigabytes in the database.
The VARCHAR2 data type should be used for fixed-length character data.
The CHAR data type requires that a minimum size be specified when defining a column of this type. (*)
Correct
2. Â Â Â Â Â Â Â A table has a column: RESPONSE_TIME. This is used to store the difference between the time the problem was reported and the time the
problem was resolved. Data in the RESPONSE_TIME column needs to be stored in days, hours, minutes and seconds. Which data type should you use?
        Mark for Review
(1) Points
DATETIME
TIMESTAMP
Correct
3. Â Â Â Â Â Â Â The SPEED_TIME column should store a fractional second value. Which data type should you use? Â Â Â Â Â Â Â Â Mark for Review
(1) Points
DATE
DATETIME
TIMESTAMP (*)
Correct
4. Â Â Â Â Â Â Â The TIMESTAMP data type allows what? Â Mark for Review
(1) Points
Correct
5. Â Â Â Â Â Â Â Evaluate this CREATE TABLE statement:
CREATE TABLE sales
(sales_id NUMBER,
customer_id NUMBER,
employee_id NUMBER,
sale_date TIMESTAMP WITH LOCAL TIME ZONE,
sale_amount NUMBER(7,2));
Which statement about the SALE_DATE column is true? Mark for Review
(1) Points
Data stored in the column will be returned in the database's local time zone. (*)
Correct
6. Â Â Â Â Â Â Â You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you
specify for this column? Â Â Mark for Review
(1) Points
CHAR
DATE
NUMBER (*)
VARCHAR2
Correct
7. Â Â Â Â Â Â Â To store time with fractions of seconds, which datatype should be used for a table column? Â Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
DATE
TIMESTAMP (*)
Correct
8. Â Â Â Â Â Â Â Which CREATE TABLE statement will fail? Â Â Â Â Â Â Â Â Mark for Review
(1) Points
Correct
9. Â Â Â Â Â Â Â Which of the following SQL statements will create a table called Birthdays with three columns for storing employee number, name and date of
birth? Â Â Â Mark for Review
(1) Points
CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Birthdate DATE); (*)
CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Date of Birth DATE);
Correct
10. Â Â Â Â Â Evaluate this CREATE TABLE statement:
Correct
11. Â Â Â Â Â Which statement about creating a table is true? Â Â Â Â Â Â Mark for Review
(1) Points
With a CREATE TABLE statement, a table will always be created in the current user's schema.
If no schema is explicitly included in a CREATE TABLE statement, the table is created in the current user's schema. (*)
If no schema is explicitly included in a CREATE TABLE statement, the CREATE TABLE statement will fail.
If a schema is explicitly included in a CREATE TABLE statement and the schema does not exist, it will be created.
Correct
12. Â Â Â Â Â You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue?
       Mark for Review
(1) Points
          Â
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, t.emp_id = e.emp_id);
          Â
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, JOIN emp_id number(10) ON employees (emp_id));
          Â
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, emp_id number(10) REFERENCES employees (emp_id));
(*)
Correct
13. Â Â Â Â Â Comments on tables and columns can be stored for documentation by: Â Â Â Mark for Review
(1) Points
Correct
14. Â Â Â Â Â Which statement about decreasing the width of a column is true? Mark for Review
(1) Points
When a character column contains data, you cannot decrease the width of the column.
When a character column contains data, you can decrease the width of the column without any restrictions.
When a character column contains data, you can decrease the width of the column if the existing data does not violate the new size. (*)
You cannot decrease the width of a character column unless the table in which the column resides is empty.
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
Correct
16. Â Â Â Â Â To do a logical delete of a column without the performance penalty of rewriting all the table datablocks you can issue the following command: Â
Mark for Review
(1) Points
Correct
17. Â Â Â Â Â Evaluate the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
The EMPLOYEE_ID column currently contains 500 employee identification numbers. Business requirements have changed and you need to allow users to include text
characters in the identification values. Which statement should you use to change this column's data type? Mark for Review
(1) Points
          Â
ALTER TABLE employees
REPLACE (employee_id VARCHAR2(9));
          Â
ALTER employees TABLE
MODIFY COLUMN (employee_id VARCHAR2(15));
          Â
You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not empty. (*)
Correct
18. Â Â Â Â Â Evaluate this statement:
Correct
19. Â Â Â Â Â You need to change the name of the EMPLOYEES table to the EMP table. Which statement should you use? Â Â Â Â Â Â Â Â Mark for Review
(1) Points
Correct
20. Â Â Â Â Â The previous administrator created a table named CONTACTS, which contains outdated data. You want to remove the table and its data from the
database. Which statement should you issue? Â Â Â Â Â Â Â Mark for Review
(1) Points
DELETE
TRUNCATE TABLE
ALTER TABLE
Correct
21. Â Â Â Â Â The EMPLOYEES table contains these columns:
You need to remove the EMPLOYEE_ID column from the EMPLOYEES table. Which statement could you use to accomplish this task? Mark for Review
(1) Points
          Â
ALTER TABLE employees
DELETE employee_id;
          Â
ALTER TABLE employees
DROP COLUMN employee_id;
(*)
          Â
Correct
22. Â Â Â Â Â Your supervisor has asked you to modify the AMOUNT column in the ORDERS table. He wants the column to be configured to accept a default
value of 250. The table constains data that you need to keep. Which statement should you issue to accomplish this task? Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
          Â
ALTER TABLE orders
MODIFY (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
23. Â Â Â Â Â Evaluate the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
Which statement should you use to increase the LAST_NAME column length to 35 if the column currently contains 200 records? Â Mark for Review
(1) Points
          Â
ALTER TABLE employees RENAME last_name VARCHAR2(35);
          Â
ALTER TABLE employees MODIFY (last_name VARCHAR2(35));
(*)
Correct
                                                         Â
Section 9
24. Â Â Â Â Â You need to ensure that the LAST_NAME column does not contain null values. Which type of constraint should you define on the LAST_NAME
column? Â Â Â Mark for Review
(1) Points
CHECK
UNIQUE
PRIMARY KEY
Correct
25. Â Â Â Â Â 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
26. Â Â Â Â Â A table can only have one unique key constraint defined. True or False? Â Mark for Review
(1) Points
True
False (*)
Correct
27. Â Â Â Â Â What is the highest number of NOT NULL constraints you can have on a table? Â Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
10
You can have as many NOT NULL constraints as you have columns in your table. (*)
Correct
28. Â Â Â Â Â Which statement about the NOT NULL constraint is true? Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
The NOT NULL constraint must be defined at the column level. (*)
The NOT NULL constraint can be defined at either the column level or the table level.
The NOT NULL constraint prevents a column from containing alphanumeric values.
Correct
29. Â Â Â Â Â 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
30. Â Â Â Â Â Which constraint can only be created at the column level? Mark for Review
(1) Points
FOREIGN KEY
UNIQUE
CHECK
Correct
31. Â Â Â Â Â What is an attribute of data that is entered into a primary key column? Â Â Â Mark for Review
(1) Points
Null and non-unique values cannot be entered into a primary key column. (*)
Data that is entered into a primary key column automatically increments by a value of 1 each time a new record is entered into the table.
Data that is entered into a primary key column references a column of the same datatype in another table.
Data that is entered into a primary key column is restricted to a range of numbers that is defined by the local Oracle database.
Correct
32. Â Â Â Â Â Evaluate this CREATE TABLE statement:
Which line will cause an error? Â Â Â Â Â Â Â Â Mark for Review
(1) Points
8 (*)
Correct
33. Â Â Â Â Â Which clause could you use to ensure that cost values are greater than 1.00? Â Â Â Â Â Â Mark for Review
(1) Points
Correct
34. Â Â Â Â Â Which of the following FOREIGN KEY Constraint keywords identifies the table and column in the parent table? Â Â Â Mark for Review
(1) Points
RESEMBLES
ON DELETE CASCADE
REFERENTIAL
REFERENCES (*)
Correct
35. Â Â Â Â Â Which type of constraint by default requires that a column be both unique and not null? Â Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
FOREIGN KEY
UNIQUE
CHECK
Correct
36. Â Â Â Â Â You need to enforce a relationship between the LOC_ID column in the FACILITY table and the same column in the MANUFACTURER table.
Which type of constraint should you define on the LOC_ID column? Â Â Â Â Â Â Â Â Mark for Review
(1) Points
UNIQUE
NOT NULL
PRIMARY KEY
37. Â Â Â Â Â Which of the following types of constraints enforces uniqueness? Â Â Â Â Â Â Â Â Â Â Â Mark for Review
(1) Points
CHECK
FOREIGN KEY
NOT NULL
Correct
38. Â Â Â Â Â You need to create the PROJECT_HIST table. The table must meet these requirements:
The table must contain the EMPLOYEE_ID and TASKED_HOURS columns for numeric data.
The table must contain the START_DATE and END_DATE column for date values.
The table must contain the HOURLY_RATE and PROJECT_COST columns for numeric data with precision and scale of 5,2 and 10,2 respectively.
The table must have a composite primary key on the EMPLOYEE_ID and START_DATE columns.
How many of the requirements does the CREATE TABLE statement satisfy? Â Â Â Mark for Review
(1) Points
Correct
39. Â Â Â Â Â Which of the following best describes the function of a CHECK constraint? Â Â Â Â Â Mark for Review
(1) Points
A CHECK constraint defines restrictions on the values that can be entered in a column or combination of columns. (*)
A CHECK constraint enforces uniqueness of the values that can be entered in a column or combination of columns.
Correct
40. Â Â Â Â Â 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
Section 9
41. Â Â Â Â Â Evaluate this statement
For which task would you issue this statement? Â Â Â Â Â Mark for Review
(1) Points
To activate a new constraint while preventing the creation of a PRIMARY KEY index
To activate the previously disabled constraint on the EMPLOYEE_ID column while creating a PRIMARY KEY index (*)
Correct
42. Â Â Â Â Â 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
ADD CONSTRAINT dept_id_fk FOREIGN KEY (department_id) REFERENCES departments(department_id);
(*)
          Â
ALTER TABLE employees
ADD FOREIGN KEY departments(department_id) REFERENCES (department_id);
          Â
Correct
43. Â Â Â Â Â Which of the following would definitely cause an integrity constraint error? Â Â Â Â Â Â Mark for Review
(1) Points
Using the DELETE command on a row that contains a primary key with a dependent foreign key declared without either an ON DELETE CASCADE or ON
DELETE SET NULL. (*)
Correct
44. Â Â Â Â Â The PO_DETAILS table contains these columns:
To drop and recreate the PRIMARY KEY constraint on the PO_NUM column
To disable the PRIMARY KEY and any FOREIGN KEY constraints that are dependent on the PO_NUM column (*)
To disable the constraint on the PO_NUM column while creating a PRIMARY KEY index
Correct
45. Â Â Â Â Â You disabled the EMPLOYEE_ID_PK PRIMARY KEY constraint on the ID column in the EMPLOYEES table and imported 100 records. You
need to enable the constraint and verify that the new and existing ID column values do not violate the PRIMARY KEY constraint. Evaluate this statement:
Which statement is true? Â Â Â Â Â Â Mark for Review
(1) Points
The statement will execute, but will ensure that the new ID values are unique.
The statement will execute, but will not verify that the existing values are unique.
The statement will NOT execute because it contains a syntax error. (*)
Correct
46. Â Â Â Â Â You need to add a PRIMARY KEY constraint on the EMP_ID column of the EMPLOYEES table. Which ALTER TABLE statement should you
use? Â Mark for Review
(1) Points
(*)
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
47. Â Â Â Â Â You need to remove the EMP_FK_DEPT constraint from the EMPLOYEES table in your schema. Which statement should you use? Â Mark for
Review
(1) Points
Correct
48. Â Â Â Â Â You need to display the names and definitions of constraints only in your schema. Which data dictionary view should you query? Â Mark for Review
(1) Points
DBA_CONSTRAINTS
USER_CONSTRAINTS (*)
ALL_CONS_COLUMNS
USER_CONS_COLUMNS
Correct
49. Â Â Â Â Â 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 CONSTRAINT dept_id_pk PRIMARY KEY (dept_id); (*)
50. Â Â Â Â Â Evaluate this statement:
ALTER TABLE employees
ADD CONSTRAINT employee_id PRIMARY KEY;
Which result will the statement provide? Â Â Â Â Mark for Review
(1) Points
Correct