Section 16
Which of the following best describes the function of the
CURRVAL virtual column?
The
CURRVAL virtual column will display either the physical locations or the
logical locations of the rows in the table.
The
CURRVAL virtual column will display the integer that was most recently supplied
by a sequence. (*)
The
CURRVAL virtual column will increment a sequence by a specified value.
The
CURRVAL virtual column will return a value of 1 for a parent record in a
hierarchical result set.
Evaluate this CREATE SEQUENCE statement:
CREATE SEQUENCE line_item_id_seq INCREMENT BY -1;
Which statement is true?
The
starting value of the LINE_ITEM_ID_SEQ sequence will by -1.
The
sequence will generate sequential descending values. (*)
The
statement will not execute successfully.
The
minimum value of the LINE_ITEM_ID_SEQ will be the smallest possible integer
value.
Evaluate this CREATE SEQUENCE
statement:
CREATE SEQUENCE order_id_seq NOCYCLE NOCACHE;
Which statement is true?
The
sequence will continue to generate values after reaching its maximum value.
The
sequence has no maximum value.
The
sequence will start with 1. (*)
The
sequence preallocates values and retains them in memory.
You created the LOCATION_ID_SEQ
sequence to generate sequential values for the LOCATION_ID column in the
MANUFACTURERS table. You issue this statement:
ALTER TABLE manufacturers
MODIFY (location_id NUMBER(6));
Which statement about the LOCATION_ID_SEQ sequence is true?
The
current value of the sequence is reset to zero.
The
sequence is unchanged. (*)
The
sequence is deleted and must be recreated.
The
current value of the sequence is reset to the sequence's START WITH value.
When creating a sequence, which
keyword or option specifies the minimum sequence value?
MAXVALUE
MINVALUE
(*)
CYCLE
NOMAXVALUE
Which statement would you use to modify the EMP_ID_SEQ
sequence used to populate the EMPLOYEE_ID column in the EMPLOYEES table?
ALTER
SEQUENCE emp_id_seq; (*)
ALTER
TABLE employees ;
CREATE
SEQUENCE emp_id_seq;
ALTER
SEQUENCE emp_id_seq.employee_id;
A sequence is a window through
which data can be queried or changed. True or False?
True
False
(*)
In order to be able to generate
primary key values that are not likely to contain gaps, which phrase should be
included in the sequence creation statement?
NOCACHE
(*)
MAXVALUE
CACHE
You want to speed up the
following query by creating an index:
SELECT * FROM employees WHERE (salary * 12) > 100000;
Which of the following will achieve this?
Create
a function_based index on ((salary * 12) > 100000).
Create
a function-based index on (salary * 12). (*)
Create
a composite index on (salary,12).
Create
an index on (salary).
You create a table named
CUSTOMERS and define a PRIMARY KEY constraint on the CUST_ID column. Which
actions occur automatically?
A CHECK
constraint is defined on the CUST_ID column.
A
unique index is created on the CUST_ID column, if one does not already exist.
(*)
A
trigger is created that will prevent NULL values from being accepted in the
CUST_ID column.
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.
All
tables must have indexes on them otherwise they cannot be queried. True or
False?
True
False
(*)
When creating an index on one or
more columns of a table, which of the following statements are true?
You
should create an index if one or more columns are frequently used together in a
join condition. (*)
You
should always create an index on tables that are frequently updated.
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. (*)
You
should create an index if the table is very small.
What would you create to make the
following statement execute faster?
SELECT *
FROM employees
WHERE LOWER(last_name) = 'chang';
A
synonym
An
index, either a normal or a function_based index (*)
A
composite index
Nothing;
the performance of this statement cannot be improved.
The EMPLOYEES table has an index
named LN_IDX on the LAST_NAME column. You want to change this index so that it
is on the FIRST_NAME column instead. Which SQL statement will do this?
ALTER
INDEX ln_idx ON employees(first_name);
ALTER
INDEX ln_idx TO employees(first_name);
ALTER
INDEX ln_idx TO fn_idx ON employees(first_name);
None of
the above; you cannot ALTER an index. (*)
What is the correct syntax for
creating a private synonym d_sum for the view DEPT_SUM_VU?
CREATE
d_sum SYNONYM
FOR dept_sum_vu;
CREATE
SYNONYM d_sum
FOR dept_sum_vu;
(*)
UPDATE
dept_sum_vu
ON SYNONYM d_sum;
CREATE
SYNONYM d_sum
ON dept_sum_vu;
No comments:
Post a Comment