MCQ Book PDF
MCQ Book PDF
MCQ Book PDF
CHAPTER
1
OCP Exam 1:
Introduction to SQL
and PL/SQL
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:42 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:4
O around the use of SQL and PL/SQL commands. To pass this exam,
you need to demonstrate an understanding of the basic SQL
constructs available in Oracle, including built-in functions. You
should also understand the basic concepts behind an Oracle
relational database management system. In more recent editions of OCP Exam 1,
the focus has included understanding of use of the PL/SQL programming language.
In addition, new features in PL/SQL introduced in Oracle8i are tested, so you should
also be sure you understand these new features.
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:43 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:5
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:43 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:6
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:43 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:7
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:43 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:8
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:43 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:9
Practice Exam 1
1. You are formulating a SQL statement to retrieve data from Oracle.
Which of the following SQL statements are invalid?
A. select NAME,Jersey_No where Jersey_No = 6;
B. select NAME, Jersey_No from PLAYERS;
C. select * from PLAYERS where Jersey_No = 6;
D. select Jersey_No from PLAYERS;
2. You can use the PL/SQL block example to answer the following question:
DECLARE
CURSOR My_Employees IS
SELECT name, title FROM employee;
My_Name VARCHAR2(30);
My_Title VARCHAR2(30);
BEGIN
OPEN My_Employees;
LOOP
FETCH My_Employees INTO My_Name, My_Title;
EXIT WHEN My_Employees%NOTFOUND;
INSERT INTO MY_EMPS (MY_EMPNAME, MY_EMPTITLE)
VALUES (My_Name, My_Title);
END LOOP;
CLOSE My_Employees;
END;
If you were rewriting this block of PL/SQL, which of the following types
of loops would you use if you wanted to reduce the amount of code by
utilizing features of the loop that handle mundane aspects of processing
automatically?
A. loop ... exit when
B. while ... loop
C. loop ... loop … end
D. cursor for loop
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:44 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:10
3. You are coding a complex PL/SQL block where several procedures call
other procedures. You have one outermost procedure that calls all other
procedures. If you wanted to prevent the user of the outermost procedure
from having the procedure fail due to an unanticipated problem, you
would include which of the following exceptions?
A. no_data_found
B. others
C. zero_divide
D. too_many_rows
4. You are attempting to develop a more robust PL/SQL application. Which
of the following keywords allow you to associate a user-defined error
message with an exception condition?
A. pragma
B. others
C. raise_application_error
D. exception
5. You are processing some data changes in your SQL*Plus session as part
of one transaction. Which of the following choices does not typically
indicate the end of a transaction?
A. Issuing an update statement
B. Issuing a commit statement
C. Issuing a rollback statement
D. Ending your session
6. You have just removed 1,700 rows from a table that were no longer
needed. In order to save the changes you’ve made to the database,
which of the following statements are used?
A. savepoint
B. commit
C. rollback
D. set transaction
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:44 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:11
7. To identify the columns that are indexed exclusively as the result of their
inclusion in a constraint, which of the following dictionary views would
be appropriate?
A. USER_INDEXES
B. USER_TAB_COLUMNS
C. USER_COLUMNS
D. USER_CONS_COLUMNS
8. You are creating some tables in your database as part of the logical data
model. Which of the following constraints have an index associated with
them that is generated automatically by Oracle?
A. UNIQUE
B. FOREIGN KEY
C. CHECK
D. NOT NULL
9. You have a table with three associated indexes, two triggers, two
references to that table from other tables, and a view. You issue the
drop table cascade constraints statement. Which of the following
objects will still remain after the statement is issued?
A. The triggers
B. The indexes
C. The foreign keys in the other tables
D. The view
10. You are using SQL operations in Oracle. All of the following DATE
functions return a DATE datatype, except one. Which one is it?
A. NEW_TIME
B. LAST_DAY
C. ADD_MONTHS
D. MONTHS_BETWEEN
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:44 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:12
11. You issue a select statement on the BANK_ACCT table containing the
order by clause. Which of the following uses of the order by clause
would produce an error?
A. order by acctno DESC;
B. order by 1;
C. order by sqrt(1);
D. order by acctno ASC;
12. You execute the query select 5 + 4 from DUAL. You have never
inserted data into the DUAL table before. Which of the following
statements best describes the DUAL table?
A. Dictionary view containing two schema names
B. Table with one column and one row used in various operations
C. Dictionary view containing two index names
D. Table with two columns and no rows used in various operations
13. You issue the following statement:
SELECT DECODE(ACCTNO, 123456, 'CLOSED', 654321, 'SEIZED',
590395, 'TRANSFER','ACTIVE') FROM BANK_ACCT;
If the value for ACCTNO is 503952, what information will this
statement display?
A. ACTIVE
B. TRANSFER
C. SEIZED
D. CLOSED
14. You are entering several dozen rows of data into the BANK_ACCT table.
Which of the following statements will enable you to execute the same
statement again and again, entering different values for variables at
statement runtime?
A. insert into BANK_ACCT (ACCTNO, NAME) VALUES
(123456,’SMITH’);
B. insert into BANK_ACCT (ACCTNO, NAME) VALUES (VAR1, VAR2);
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:44 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:13
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:44 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:14
18. Each of the following statements is true about referential integrity, except
one. Which is it?
A. The referencing column in the child table must correspond with a
primary key in the parent.
B. All values in the referenced column in the parent table must be present
in the referencing column in the child.
C. The datatype of the referenced column in the parent table must be
identical to the referencing column in the child.
D. All values in the referencing column in the child table must be present
in the referenced column in the parent.
19. You have a group of values from a column in a table, and you would like
to perform a group operation on them. Each of the following functions
operate on data from all rows as a group, except for which of the
following choices?
A. avg( )
B. sqrt( )
C. count( )
D. stddev( )
20. You have a situation where you need to use the nvl( ) function. All
the following statements about the nvl( ) function are true except one.
Which is it?
A. nvl( ) returns the second value passed if the first value is NULL.
B. nvl( ) handles values of many different datatypes.
C. nvl( ) returns NULL if the first value is not equal to the second.
D. Both the values passed for nvl( ) must be the same datatype.
21. You are developing a stored procedure that handles table data. The
%rowtype expression in PL/SQL allows you to declare which of the
following kinds of variables?
A. Records
B. VARCHAR2s
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:45 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:15
C. PLS_INTEGERs
D. NUMBERs
22. You create a sequence with the following statement:
CREATE SEQUENCE MY_SEQ
START WITH 394
INCREMENT BY 12
NOMINVALUE
NOMAXVALUE
NOCACHE
NOCYCLE;
Three users have already issued SQL statements to obtain NEXTVAL, and
four more have issued SQL statements to obtain CURRVAL. If you issue a
SQL statement to obtain the NEXTVAL, what will Oracle return?
A. 406
B. 418
C. 430
D. 442
23. Table EMP has 17,394,430 rows in it. You issue a delete from EMP
statement, followed by a commit. Then, you issue a select count(*)
to find out how many rows there are in the table. Several minutes later,
Oracle returns 0. Why did it take so long for Oracle to obtain this information?
A. The table was not empty.
B. The high-water mark was not reset.
C. Oracle always performs slowly after a commit is issued.
D. The table data did not exist to be counted anymore.
24. After creating a view, you realize that several columns were left out.
Which of the following statements would you issue in order to add some
columns to your view?
A. alter view
B. create or replace view
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:45 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:16
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:45 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:17
28. You are developing PL/SQL code to manipulate and store data in an
Oracle table. All of the following numeric datatypes in PL/SQL can be
stored in an Oracle database, except one. Which is it?
A. CHAR
B. RAW
C. DATE
D. INTEGER
29. You are performing some conversion operations in your PL/SQL programs.
To convert a date value into a text string, you would use which of the
following conversion functions?
A. CONVERT
B. TO_CHAR
C. TO_NUMBER
D. TO_DATE
30. Your attempt to read the view creation code stored in the Oracle data
dictionary has encountered a problem. The view code appears to be
getting cut off at the end. In order to resolve this problem, which of the
following measures are appropriate?
A. Increase the size of the dictionary view.
B. Increase your user view allotment with the alter user statement.
C. Use the set long statement.
D. Use the set NLS_DATE_FORMAT statement.
31. You issue the following update statement against the Oracle database:
UPDATE BANK_ACCT SET NAME = 'SHAW';
Which records will be updated in that table?
A. The first record only
B. All records
C. The last record only
D. None of the records
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:45 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:18
32. You are coding a complex PL/SQL block where several procedures call
other procedures. You have one outermost procedure that calls all other
procedures. If you only wanted to prevent the procedure from failing due
to a situation where a select into statement received two or more
records, you would include which of the following exceptions?
A. too_many_rows
B. others
C. zero_divide
D. no_data_found
33. You create a table but then subsequently realize you needed a few new
columns. To add those columns later, you would issue which of the
following statements?
A. create or replace table
B. alter table
C. create table
D. truncate table
34. You are busy creating your tables based on a logical data model. Which
of the following constraints require the references privilege in order
to be created?
A. UNIQUE
B. FOREIGN KEY
C. CHECK
D. NOT NULL
35. The INVENTORY table has three columns: UPC_CODE, UNITS, and
DELIV_DATE. The primary key is UPC_CODE. New records are added
daily through a view. The view was created using the following code:
CREATE VIEW DAY_INVENTORY_VW
AS SELECT UPC_CODE, UNITS, DELIV_DATE
FROM INVENTORY
WHERE DELIV_DATE = SYSDATE
WITH CHECK OPTION;
What happens when a user tries to insert a record with duplicate
UPC_CODE?
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:45 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:19
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:46 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:20
A. DATE variables
B. TEXT variables
C. PLS_INTEGER variables
D. REAL variables
40. Review the following transcript of a SQL*Plus session:
INSERT INTO INVENTORY (UPC_CODE, PRODUCT )
VALUES (503949353,'HAZELNUT COFFEE');
INSERT INTO INVENTORY (UPC_CODE, PRODUCT)
VALUES (593923506,'SKIM MILK');
INSERT INTO INVENTORY (UPC_CODE, PRODUCT)
VALUES (402392340,'CANDY BAR');
SAVEPOINT INV1;
UPDATE INVENTORY SET UPC_CODE = 50393950
WHERE UPC_CODE = 402392340;
UPDATE INVENTORY SET UPC_CODE = 4104930504
WHERE UPC_CODE = 402392340;
COMMIT;
UPDATE INVENTORY SET PRODUCT = (
SELECT PRODUCT FROM INVENTORY
WHERE UPC_CODE = 50393950)
WHERE UPC_CODE = 593923506;
ROLLBACK;
Which of the following UPC codes will not have records in the
INVENTORY table as a result of this series of operations?
A. 593923506
B. 503949353
C. 4104930504
D. 50393950
41. You are cleaning information out of the Oracle database. Which of the
following statements will get rid of all views that use a table at the same
time you eliminate the table from the database?
A. drop view
B. alter table
C. drop index
D. alter table drop constraint
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:46 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:21
42. You want to join data from four tables into one result set and display that
set in your session. Table A has a column in common with table B, table B
with table C, and table C with table D. You want to further restrict data
returned from the tables by only returning data where values in the
common column shared by A and B equals 5. How many conditions
should you have in the where clause of your select statement?
A. 2
B. 3
C. 4
D. 5
43. You are developing some code in PL/SQL. If you wanted to declare
variables that could be used to store table column values, but didn’t
know the actual datatype of that column, PL/SQL allows you to declare
which of the following kinds of variables?
A. %rowtype variables
B. %type variables
C. FLOAT variables
D. VARCHAR2 variables
44. You are attempting to explain the Oracle security model for an Oracle
database to the new security administrator. What are two components
of the Oracle database security model?
A. Password authentication and granting privileges
B. Password authentication and creating database objects
C. Creating database objects and creating users
D. Creating users and password authentication
45. You have a script you plan to run using SQL*Plus that contains several
SQL statements that manage milk inventory in several different tables
based on various bits of information. You want the output to go into a
file for review later. Which command would you use?
A. prompt
B. echo
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:46 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:22
C. spool
D. define
46. Your application’s business logic aligns closely with an Oracle internal
error. If you wanted to associate that internal error with a named exception
for handling in your application, in which of the following areas in your
procedure code must you include some support of this exception?
A. DECLARATION and EXCEPTION only.
B. DECLARATION, EXECUTION, and EXCEPTION.
C. EXCEPTION only.
D. No coding, definition, or exception handlers are required to raise
this exception.
47. You have a table called TEST_SCORE that stores test results by student
personal ID number, test location, and date the test was taken. Tests given
in various locations throughout the country are stored in this table. A
student is not allowed to take a test for 30 days after failing it the first
time, and there is a check in the application preventing the student from
taking a test twice in 30 days at the same location. Recently, it has come
to everyone’s attention that students are able to circumvent the 30-day
rule by taking a test in a different location. Which of the following SQL
statements would be useful for identifying the students who have done so?
A. select A.STUDENT_ID, A.LOCATION, B.LOCATION from
TEST_SCORE A, TEST_SCORE B where A.STUDENT_ID =
B.STUDENT_ID AND A.LOCATION = B.LOCATION AND
trunc(A.TEST_DATE)+30 <= trunc(B.TEST_DATE) AND
trunc(A.TEST_DATE)-30 >= trunc(B.TEST_DATE);
B. select A.STUDENT_ID, A.LOCATION, B.LOCATION from
TEST_SCORE A, TEST_SCORE B where A.STUDENT_ID =
B.STUDENT_ID AND A.LOCATION <> B.LOCATION AND
trunc(A.TEST_DATE)+30 >= trunc(B.TEST_DATE) AND
trunc(A.TEST_DATE)-30 <= trunc(B.TEST_DATE);
C. select A.STUDENT_ID, A.LOCATION, B.LOCATION from
TEST_SCORE A, TEST_SCORE B where A.STUDENT_ID =
B.STUDENT_ID AND A.LOCATION = B.LOCATION AND
trunc(A.TEST_DATE)+30 >= trunc(B.TEST_DATE) AND
trunc(A.TEST_DATE)-30 <= trunc(B.TEST_DATE);
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:46 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:23
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:47 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:24
A. alter user
B. alter table
C. alter role
D. alter index
52. User SNOW executes the following statement: select * from EMP.
This statement executes successfully, and SNOW can see the output.
Table EMP is owned by user REED. What object would be required in
order for this scenario to happen?
A. User SNOW would need the role to view table EMP.
B. User SNOW would need the privileges to view table EMP.
C. User SNOW would need a synonym for table EMP.
D. User SNOW would need the password for table EMP.
53. You develop a PL/SQL block containing a complex series of data changes.
A user then executes your PL/SQL block. At what point will the data
changes made be committed to the database?
A. When the PL/SQL block finishes
B. After each individual update
C. Whenever the commit command is issued
D. When you, the creator of the PL/SQL block, disconnect from your
session
54. If you would like to code your PL/SQL block to select some data from a
table, and then run through each row of output and perform some work,
which of the following choices best identifies how you would do so?
A. Implicit cursors with a cursor for loop
B. Implicit cursors with implicit cursor attributes
C. Explicit cursors with a cursor for loop
D. Explicit cursors with implicit cursor attributes
55. You have the following code block declaration in PL/SQL:
DECLARE
CURSOR EMP_1 IS
SELECT * FROM EMP
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:47 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:25
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:47 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:26
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:47 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:27
Practice Exam 2
1. Which of the following choices identifies a PL/SQL block containing the
correct syntax for a cursor for loop?
A. DECLARE
CURSOR My_Employees IS
SELECT * FROM employee;
My_NameVARCHAR2(30);
My_Title VARCHAR2(30);
BEGIN
OPEN My_Employees;
FOR csr_rec IN My_Employees LOOP
INSERT INTO MY_EMPS (MY_EMPNAME, MY_EMPTITLE)
VALUES (My_Name, My_Title);
END LOOP;
CLOSE My_Employees;
END;
B. DECLARE
CURSOR My_Employees IS
SELECT * FROM employee;
csr_rec VARCHAR2(30);
BEGIN
FOR csr_rec IN My_Employees LOOP
EXIT WHEN My_Employees%NOTFOUND;
INSERT INTO MY_EMPS (MY_EMPNAME, MY_EMPTITLE)
VALUES (csr_rec.name, csr_rec.title);
END LOOP;
END;
C. DECLARE
CURSOR My_Employees IS
SELECT name, title FROM employee;
BEGIN
FOR csr_rec IN My_Employees LOOP
INSERT INTO MY_EMPS (MY_EMPNAME, MY_EMPTITLE)
VALUES (csr_rec.name, csr_rec.title);
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:47 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:28
END LOOP;
END;
D. DECLARE
CURSOR My_Employees IS
SELECT name, title FROM employee;
My_Name VARCHAR2(30);
My_Title VARCHAR2(30);
BEGIN
OPEN My_Employees;
LOOP
FETCH My_Employees INTO My_Name, My_Title;
EXIT WHEN My_Employees%NOTFOUND;
INSERT INTO MY_EMPS (MY_EMPNAME, MY_EMPTITLE)
VALUES (My_Name, My_Title);
END LOOP;
CLOSE My_Employees;
END;
2. Your attempt to read the view creation code stored in the Oracle data
dictionary has encountered a problem. The view code appears to be
getting cut off at the end. In order to resolve this problem, which of
the following measures are appropriate?
A. Increase the size of the dictionary view.
B. Increase your user view allotment with the alter user statement.
C. Use the set long statement.
D. Use the set NLS_DATE_FORMAT statement.
3. Inspect the following SQL statement:
SELECT FARM_NAME, COW_NAME,
COUNT(CARTON) AS NUMBER_OF_CARTONS
FROM COW_MILK
GROUP BY COW_NAME;
Which of the following choices contains the line with the error?
A. select FARM_NAME, COW_NAME,
B. count(CARTON) as NUMBER_OF_CARTONS
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:48 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:29
C. from COW_MILK
D. group by COW_NAME;
E. There are no errors in the statement.
4. All of the following types of PL/SQL blocks are stored within the Oracle
database for reusability, except for one type. Which type is it?
A. Functions
B. Procedures
C. Package specs
D. Package bodies
E. Anonymous blocks
F. Triggers
5. Inspect the following SQL statement:
SELECT COW_NAME,
MOD(CARTON, FILL_STATUS)
FROM COW_MILK
GROUP BY COW_NAME;
Which of the following lines contains an error?
A. select COW_NAME,
B. mod(CARTON, FILL_STATUS)
C. from COW_MILK
D. group by COW_NAME;
E. There are no errors in this statement.
6. You are writing queries against an Oracle database. Which of the
following queries takes advantage of an inline view?
A. select * from EMP_VW where EMPID = (select EMPID from
INVOICE where INV_NUM = 5506934);
B. select A.LASTNAME, B.DEPT_NO from EMP A, (select EMPID,
DEPT_NO from DEPT) B where A.EMPID = B.EMPID;
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:48 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:30
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:48 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:31
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:48 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:32
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:49 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:33
13. You have created a table called EMP with a primary key called
EMP_PK_01. In order to identify any objects that may be associated
with that table and primary key, what dictionary views and characteristics
would you look for?
A. USER_SEQUENCES, sequences created at the same time
B. USER_TABLES, tables with the same number of columns
C. USER_IND_COLUMNS, constraints with the same name as the table
D. USER_INDEXES, indexes with the same name as the constraint
14. You are designing your database, and you are attempting to determine the
best method for indexing your tables. Identify a main advantage for using
bitmap indexes on a database.
A. To improve performance on columns with many unique values
B. To improve performance on columns with few unique values
C. To improve performance on columns with all unique values
D. To improve performance on sequences with all unique values
15. You can use the PL/SQL block example to answer the following question:
DECLARE
CURSOR CARTON_CRSR IS
SELECT CARTON FROM MILK;
MY_CARTON MILK.CARTON%TYPE;
BEGIN
OPEN CARTON_CRSR;
LOOP
FETCH CARTON_CRSR INTO MY_CARTON;
INSERT INTO MY_MILK_CRATE (CARTON)
VALUES (MY_CARTON);
END LOOP;
CLOSE CARTON_CRSR;
END;
What is wrong with this PL/SQL block?
A. It will not work unless the loop is rewritten as a cursor for loop.
B. The exception handler must be defined if cursor is not declared.
C. The user does not have permission to execute the block.
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:49 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:34
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:49 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:35
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:49 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:36
different tables based on name. Since the script only changes information
for one person, you want the ability to enter the name only once, and
have that information reused throughout the script. Which of the following
options is the best way to accomplish this goal in such a way that you
don’t have to modify the script each time you want to run it?
A. Use define to capture name value for each run.
B. Use accept to capture name value for each run.
C. Using the & character to specify lexical substitution for names at runtime.
D. Hardcode names in all SQL statements, and change the value each run.
23. You need to undo some data changes. Which of the following data
changes cannot be undone using the rollback command?
A. update
B. truncate
C. delete
D. insert
24. You are developing some code to handle transaction processing. Each of
the following items signifies the beginning of a new transaction, except
one. Which is it?
A. savepoint
B. set transaction
C. Opening a new session
D. commit
25. The following SQL statement is invalid:
SELECT PRODUCT, BRAND
WHERE UPC_CODE = '650-35365656-34453453454-45';
Which of the following choices indicate an area of change that would
make this statement valid?
A. A select clause
B. A from clause
C. A where clause
D. An order by clause
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:49 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:37
26. You can use the PL/SQL block example to answer the following question:
DECLARE
CURSOR UPC_CODE_CRSR IS
SELECT UPC_CODE FROM INVENTORY;
MY_UPC_CODE INVENTORY%ROWTYPE;
BEGIN
OPEN UPC_CODE_CRSR;
LOOP
FETCH UPC_CODE_CRSR INTO MY_UPC_CODE;
EXIT WHEN UPC_CODE_CRSR%NOTFOUND;
INSERT INTO MY_SHOPPING_CART (UPC_CODE)
VALUES (UPC_CODE_CRSR);
END LOOP;
CLOSE UPC_CODE_CRSR;
END;
What is wrong with this PL/SQL block?
A. It will not work unless loop is rewritten as a cursor for loop.
B. The exception handler must be defined if a cursor is not declared.
C. The user does not have permission to execute the block.
D. Values from a cursor cannot be referenced directly.
27. You are coding a PL/SQL block. PROC_A calls PROC_B, which then calls
PROC_C, and PROC_B has no exception handler. If you wanted to prevent
the PROC_A procedure from failing due to a situation in PROC_B where
the divisor in a division statement was zero, how would you address this
in your code?
A. Use an if %zero_divide statement immediately following the
math operation.
B. Code a when zero_divide exception handler in PROC_C.
C. Code a when others exception handler in PROC_A.
D. Code a when others exception handler in PROC_C.
28. If you wanted to define an exception that caused no Oracle errors but
represented a violation of some business rule in your application, in which
of the following areas in your procedure code must you include some
support of this exception?
A. DECLARATION and EXCEPTION only
B. DECLARATION, EXECUTION, and EXCEPTION
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:50 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:38
C. EXCEPTION only
D. No coding or definition is required to raise this exception.
29. You are at the beginning of your current transaction and want to prevent
your transaction from being able to change data in the database. To prevent
any statements in the current transaction from altering database tables,
which statement is used?
A. set transaction
B. rollback
C. commit
D. savepoint
30. Your application searches for data in the EMP table on the database on a
nullable column indicating whether a person is male or female. To improve
performance, you decide to index it. The table contains over 2,000,000
rows, and the column contains few NULL values. Which of the following
indexes would be most appropriate?
A. Nonunique B-tree index
B. Unique B-tree index
C. Bitmap index
D. Primary-key indexes
31. Your employee expense application stores information for invoices in one
table. Each invoice can have several items, which are stored in another
table. Each invoice may have one or more items, or none at all, but every
item must correspond to one invoice. The relationship between the INVOICE
table and INVOICE_ITEM table is best marked as what kind of relationship
on a logical data model?
A. Optional, one-to-many
B. Mandatory, one-to-many
C. Mandatory, one-to-one
D. Optional, one-to-one
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:50 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:39
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:50 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:40
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:50 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:41
Which of the following choices identifies both the type of query and the
expected result from the Oracle database?
A. Single-row subquery, the youngest contestant from one country
B. Multiple-row subquery, the youngest contestant from all countries
C. Multiple-column subquery, the youngest contestant from all countries
D. Multiple-column subquery, Oracle will return an error because = should
replace in
39. The contents of the CONTESTANTS table are listed as follows:
NAME AGE COUNTRY
---------------- -------------- ---------------
BERTRAND 24 FRANCE
GONZALEZ 29 SPAIN
HEINRICH 22 GERMANY
TAN 39 CHINA
SVENSKY 30 RUSSIA
SOO 21
You issue the following query against this table:
SELECT NAME FROM CONTESTANT
WHERE (COUNTRY, AGE) IN ( SELECT COUNTRY, MIN(AGE)
FROM CONTESTANT GROUP BY COUNTRY);
Which of the following contestants will not be listed among the output?
A. SOO
B. HEINRICH
C. BERTRAND
D. GONZALEZ
40. An object in Oracle contains many columns that are functionally
dependent on the key column for that object. The object requires
segments to be stored in areas of the database other than the data
dictionary. The object in question is correctly referred to as which
of the following objects?
A. CURSOR
B. TABLE
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:42
C. SEQUENCE
D. VIEW
41. You are defining where to place information in a PL/SQL block. If you
wanted the block to contain a conditional operation that determined
whether a portion of code would be executed based on the value returned
from a query, which section of the PL/SQL block would you write the
code into?
A. Declaration
B. Executable
C. Exception
D. Package specification
42. You can use the following PL/SQL block to answer this question:
DECLARE
CURSOR UPC_CODE_CRSR IS
SELECT UPC_CODE FROM INVENTORY;
BEGIN
MY_UPC_CODE INVENTORY%ROWTYPE;
OPEN UPC_CODE_CRSR;
LOOP
FETCH UPC_CODE_CRSR INTO MY_UPC_CODE;
EXIT WHEN UPC_CODE_CRSR%NOTFOUND;
INSERT INTO MY_SHOPPING_CART (UPC_CODE)
VALUES (UPC_CODE_CRSR);
END LOOP;
CLOSE UPC_CODE_CRSR;
END;
What is wrong with this code block?
A. The variable is declared incorrectly.
B. Appropriate looping values are not used.
C. The insert statement is incorrectly defined.
D. The loop must be closed in the exception handler.
43. You need to execute a PL/SQL procedure. Which of the following choices
does not represent a way to do so?
A. With the execute command from SQL*Plus
B. From within a procedure
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:43
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:44
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:45
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:46
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:51 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:47
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:52 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:48
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:52 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:49
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:52 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:50
Practice Exam 3
1. You are implementing transaction control in a PL/SQL block. Which of
the following choices best describes the use of autonomous transactions
in your database?
A. A developer wants records to be added to an EXIT_STATUS table
regardless of whether the transaction completed successfully or not.
B. Two users on the Oracle database are modifying records in different
tables at the same time.
C. Two users on the Oracle database are modifying different records in the
same table at the same time.
D. Two users on the Oracle database are modifying the same records in the
same table at the same time.
2. You need to compute an N-dimensional cross-tabulation in your SQL
statement output for reporting purposes. Which of the following Oracle8i
clauses can be used for this purpose?
A. having
B. cube
C. rollup
D. trim( )
3. You are using summaries in the Oracle8i database for data warehousing.
Which of the following clauses is implicitly added by Oracle8i to queries
in order to take advantage of summary management?
A. order by
B. group by
C. cube
D. rollup
4. You are managing a data warehouse using Oracle8i. Which of the following
choices identifies a key aspect of dimension creation that must be addressed
when the dimension is created?
A. cube operation
B. rollup operation
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:52 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:51
C. Summary management
D. Level hierarchy
5. You need to define a collection type for student exam records in an
Oracle8i database. Each record will consist of student vital information,
along with the answers each student gave on every exam they took in the
class. You want the ability to reference specific questions on exams for
individual students for comparison purposes. Which of the following
choices identifies the best way to do it?
A. Scalar datatypes
B. User-defined type
C. VARRAY
D. Nested table
6. You are indexing Oracle data in an application. The index will be on
a column containing sequential numbers with at least seven significant
digits. Most, if not all, entries will start with 1. Which of the following
indexes would be best suited for the task?
A. B-tree indexes
B. Reverse-key indexes
C. Bitmap indexes
D. Descending indexes
7. You need to store a large block of text data in Oracle. These text blocks
will be around 3,500 characters in length. Which datatype would you use
for storing these large objects?
A. VARCHAR2
B. CLOB
C. BLOB
D. BFILE
8. Two users exist on an Oracle8i system, named FLUFFY and MUFFY.
MUFFY owns a PL/SQL procedure called foobar( ), defined as follows:
create procedure FOOBAR
authid current_user
is
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:52 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:52
var1 number;
begin
select * into var1 from foo;
end;
To use procedure foobar( ), what privileges does FLUFFY need granted to
her (choose as many as appropriate)?
A. create procedure on schema MUFFY
B. execute on procedure foobar( )
C. update on table FOO
D. select on table FOO
9. User MILTON issues the following code block in his SQL*Plus session:
CREATE OR REPLACE PROCEDURE upd_tran
( PVAL1 IN VARCHAR2) IS
PRAGMA AUTONOMOUS_TRANSACTION;
MY_VAL2 NUMBER(10);
BEGIN
SELECT COL_1 INTO MY_VAL2
FROM TAB_2 WHERE COL_2 = PVAL1;
UPDATE TAB_1 SET COL_1 = PVAL1
WHERE COL_2 = PVAL2;
COMMIT;
END;
Later, another procedure called my_tran( ) is defined by user GOETHE,
which calls upd_tran( ) as part of an application. Which of the following
statements is true about this application?
A. Any transaction in progress in my_tran( ) when upd_tran( ) is
called will be committed when upd_tran( ) completes.
B. Any uncommitted changes made to table TAB_2 by my_tran( ) will
not be seen by upd_tran( ).
C. Procedure upd_tran( ) has no problem updating TAB_1 if my_tran(
) has already done so without issuing a commit
before the call to upd_tran( ).
D. User GOETHE needs to have update privileges on TAB_1 to execute
procedure upd_tran( ).
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:53 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:53
10. Developer JANET receives an error due to the following statement in the
DECLARATION section:
PI CONSTANT NUMBER;
The problem is because of which of the following causes?
A. There is not enough memory in the program for the constant.
B. There is no value associated with the constant.
C. There is no datatype associated with the constant.
D. pi is a reserved word.
11. You are designing your PL/SQL exception handler inside a nested block.
Which statement most accurately describes the result of not creating an
exception handler for a raised exception?
A. The program will continue without raising the exception.
B. There will be a memory leak.
C. Control will pass to the PL/SQL block caller’s exception handler.
D. The program will return a %notfound error.
12. You are determining what types of cursors to use in your PL/SQL code.
Which of the following statements is true about implicit cursors?
A. Implicit cursors are used for SQL statements that are not named.
B. Developers should use implicit cursors with great care.
C. Implicit cursors are used in cursor for loops to handle data
processing.
D. Implicit cursors are no longer a feature in Oracle.
13. You are constructing PL/SQL process flow for your program. Which of
the following is not a feature of a cursor for loop?
A. Record-type declaration
B. Opening and parsing of SQL statements
C. Fetches records from cursor
D. Requires exit condition to be defined
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:53 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:54
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:53 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:55
18. You are coding your exception handler. The others exception handler is
used to handle all of the following exceptions, except one. Which exception
does the others exception handler not cover?
A. no_data_found
B. others
C. rowtype_mismatch
D. too_many_rows
19. You are defining a cursor in your PL/SQL block. Which line in the
following statement will produce an error?
A. cursor action_cursor is
B. select name, rate, action
C. into action_record
D. from action_table;
E. There are no errors in this statement.
20. You are developing PL/SQL process flow into your program. The command
used to open a cursor for loop is which of the following keywords?
A. open
B. fetch
C. parse
D. None, cursor for loops handle cursor opening implicitly.
21. You are determining the appropriate program flow for your PL/SQL
application. Which of the following statements are true about while loops?
A. Explicit exit statements are required in while loops.
B. Counter variables are required in while loops.
C. An if-then statement is needed to signal when a while loop
should end.
D. All exit conditions for while loops are handled in the exit
when clause.
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:53 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:56
22. For the following question, assume that before the following PL/SQL block
is executed, table OPERATIONS contains one column called STATUS, and
one row with the value PROCESSING.
DECLARE
VAR1 VARCHAR2(1);
VAR2 VARCHAR2(1);
IS
BEGIN
SELECT TO_CHAR(CEIL(SQRT(40)))
INTO VAR2
FROM DUAL;
SELECT SUBSTR(STATUS,4,1)
INTO VAR1
FROM OPERATIONS;
IF VAR1 = 'H' THEN
VAR2 := '5';
ELSIF VAR1 = 'C' THEN
VAR2 := 'L';
ELSE
VAR2 = '9';
END IF;
INSERT INTO OPERATIONS VALUES (VAR2);
COMMIT;
END;
What is the value of the STATUS column after executing this code block?
A. 5
B. 7
C. L
D. 9
E. J
23. You create the following PL/SQL block:
DECLARE
MYVAR1 CONSTANT NUMBER := 100;
MYVAR2 NUMBER := 0;
BEGIN
SELECT ITEM
INTO VAR2
FROM ITEM_TABLE
WHERE NAME = 'SMITH';
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:53 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:57
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:54 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:58
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:54 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:59
31. Which of the following statements are true about roles? (Choose three.)
A. Roles can be granted to other roles.
B. Privileges can be granted to roles.
C. Roles can be granted to users.
D. Roles can be granted to synonyms.
32. After referencing NEXTVAL, the value in CURRVAL:
A. Is incremented by one
B. Is now in PREVVAL
C. Is equal to NEXTVAL
D. Is unchanged
33. The EMP_SALARY table has two columns, EMP_USER and SALARY.
EMP_USER is set to be the same as the Oracle username. To support
user MARTHA, the salary administrator, you create a view with the
following statement:
CREATE VIEW EMP_SAL_VW
AS SELECT EMP_USER, SALARY
FROM EMP_SALARY
WHERE EMP_USER <> 'MARTHA';
MARTHA is supposed to be able to view and update anyone’s salary in
the company, except her own, through this view. Which of the following
clauses do you need to add to your view creation statement in order to
implement this functionality?
A. with admin option
B. with grant option
C. with security option
D. with check option
34. The INVENTORY table has three columns: UPC_CODE, UNITS, and
DELIV_DATE. The primary key is UPC_CODE. New records are added
daily through a view. The view was created using the following code:
CREATE VIEW DAY_INVENTORY_VW
AS SELECT UPC_CODE, UNITS, DELIV_DATE
FROM INVENTORY
WHERE DELIV_DATE = SYSDATE
WITH CHECK OPTION;
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:54 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:60
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:54 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:61
38. Which of the following dictionary views gives information about the
position of a column in a primary key?
A. ALL_PRIMARY_KEYS
B. USER_CONSTRAINTS
C. ALL_IND_COLUMNS
D. ALL_TABLES
39. Developer ANJU executes the following statement: create table
ANIMALS as select * from MASTER.ANIMALS; What is the effect
of this statement?
A. A table named ANIMALS will be created in the MASTER schema with
the same data as the ANIMALS table owned by ANJU.
B. A table named ANJU will be created in the ANIMALS schema with the
same data as the ANIMALS table owned by MASTER.
C. A table named ANIMALS will be created in the ANJU schema with the
same data as the ANIMALS table owned by MASTER.
D. A table named MASTER will be created in the ANIMALS schema with
the same data as the ANJU table owned by ANIMALS.
40. User JANKO would like to insert a row into the EMPLOYEE table that has
three columns: EMPID, LASTNAME, and SALARY. The user would like to
enter data for EMPID 59694, LASTNAME Harris, but no salary. Which
statement would work best?
A. insert into EMPLOYEE values (59694,’HARRIS’, NULL);
B. insert into EMPLOYEE values (59694,’HARRIS’);
C. insert into EMPLOYEE (EMPID, LASTNAME, SALARY) values
(59694,’HARRIS’);
D. insert into EMPLOYEE (select 59694 from ’HARRIS’);
41. No relationship officially exists between two tables. Which of the
following choices is the strongest indicator of a parent/child relationship?
A. Two tables in the database are named VOUCHER and
VOUCHER_ITEM, respectively.
B. Two tables in the database are named EMPLOYEE and PRODUCTS,
respectively.
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:55 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:62
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:55 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:63
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:55 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:64
50. You are managing constraints on a table in Oracle. Which of the following
choices correctly identifies the limitations on CHECK constraints?
A. Values must be obtained from a lookup table.
B. Values must be part of a fixed set defined by create or alter table.
C. Values must include reserved words like SYSDATE and USER.
D. Column cannot contain a NULL value.
51. Which of the following is not a group function?
A. avg( )
B. sqrt( )
C. sum( )
D. max( )
52. In order to perform an inner join, which criteria must be true?
A. The common columns in the join do not need to have shared values.
B. The tables in the join need to have common columns.
C. The common columns in the join may or may not have shared values.
D. The common columns in the join must have shared values.
53. Once defined, how long will a variable remain defined in SQL*Plus?
A. Until the database is shut down
B. Until the instance is shut down
C. Until the statement completes
D. Until the session completes
54. You want to change the prompt Oracle uses to obtain input from a user.
Which two of the following choices are used for this purpose? (Choose two.)
A. Change the prompt in the config.ora file.
B. Alter the prompt clause of the accept command.
C. Enter a new prompt in the login.sql file.
D. There is no way to change a prompt in Oracle.
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:55 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:65
55. No search criteria for the EMPLOYEE table are known. Which of the
following options is appropriate for use when search criteria are unknown
for comparison operations in a select statement? (Choose two.)
A. select * from EMPLOYEE where empid = &empid;
B. select * from EMPLOYEE where empid = 69494;
C. select * from EMPLOYEE where empid =
(select empid from invoice where invoice_no = 4399485);
D. select * from EMPLOYEE;
56. The default character for specifying substitution variables in select
statements is
A. Ampersand
B. Ellipses
C. Quotation marks
D. Asterisk
57. A user is setting up a join operation between tables EMPLOYEE and DEPT.
There are some employees in the EMPLOYEE table that the user wants
returned by the query, but the employees are not assigned to department
heads yet. Which select statement is most appropriate for this user?
A. select e.empid, d.head from EMPLOYEE e, dept d;
B. select e.empid, d.head from EMPLOYEE e, dept d where
e.dept# = d.dept#;
C. select e.empid, d.head from EMPLOYEE e, dept d where
e.dept# = d.dept# (+);
D. select e.empid, d.head from EMPLOYEE e, dept d where
e.dept# (+) = d.dept#;
58. Which three of the following uses of the having clause are appropriate?
(Choose three.)
A. To put returned data into sorted order
B. To exclude certain data groups based on known criteria
C. To include certain data groups based on unknown criteria
D. To include certain data groups based on known criteria
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:55 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:66
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:56 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:67
3. B. others
Explanation A special exception called others exists in PL/SQL that will handle
all unhandled exceptions captured at that level of processing. Although Oracle will
raise the zero_divide exception automatically whenever you attempt to divide a
number by zero, coding an exception handler for zero_divide only defines what
happens when zero_divide is raised. It does not, for example, handle situations
where another exception gets raised, as others does. The no_data_found and
too_many_rows exceptions are raised when no data or too much data is returned
by an implicit or explicit cursor, respectively. (Topic 24.4)
4. C. raise_application_error
Explanation The raise_application_error function allows Oracle to return
a user-defined error message when an exception condition is raised. The pragma
exception_init keywords (of which pragma is a subset) indicate a compiler
directive where you tell Oracle you want to associate an internal error with an
exception name of your own devises. The others exception is a catchall for processing
exceptions that would otherwise escape unhandled. Finally, the exception keyword
is used to denote the exceptions section of your code block. (Topic 24.6)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:56 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:68
6. B. commit
Explanation In order to save any change you make in Oracle, you will use
the commit command. The savepoint command merely identifies a logical
breakpoint in your transaction that you can use to break up complex units of work.
The rollback command discards every change you made since the last commit.
Finally, the set transaction command will set up the transaction to be
read-only against the Oracle database. (Topic 10.5)
7. D. USER_CONS_COLUMNS
Explanation The USER_CONS_COLUMNS dictionary view shows you all the
columns in tables belonging to that user that are part of indexes used to enforce
constraints. USER_INDEXES is incorrect because that view only displays information
about the index itself, not the columns in the index. USER_TAB_COLUMNS displays
all the columns in all tables owned by that user. Finally, USER_COLUMNS is not an
actual view in the Oracle database. (Topic 14.2)
8. A. UNIQUE
Explanation Only UNIQUE and PRIMARY KEY constraints require Oracle to
generate an index that supports or enforces the uniqueness of the column values.
Foreign keys do not require this sort of index. CHECK constraints also do not require
an index. Finally, NOT NULL constraints do not require an index, either. (Topic 12.1)
9. D. The view
Explanation When you drop a table with the cascade constraints option,
Oracle removes all associated indexes, triggers, and constraints that reference that
table from other tables. Oracle does not remove the views that use that table,
however—you must do that manually with the drop view statement. (Topic 11.5)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:56 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:69
10. D. MONTHS_BETWEEN
Explanation Each of the choices accepts as input a DATE datatype and returns a
DATE datatype—with one exception. The MONTHS_BETWEEN function returns a
number indicating how many months there are between the two dates you give it.
This number will be displayed with numbers to the right of the decimal point, which
you can round off if you like. All the rest of the choices return a DATE value in one
form or another. (Topic 4.2)
12. B. Table with one column and one row used in various operations
Explanation The DUAL table is a special table in Oracle used to satisfy the
requirement of a from clause in your SQL statements. It contains one column and
one row of data. It is not a dictionary view; rather, it is an actual table. Thus, you
should understand why the answer is what it is in this question. As a side note, you
would use the DUAL table in arithmetic expressions and would not actually pull
real data from the database. Finally, you should never insert data into the DUAL
table under any circumstance. (Topic 2.1)
13. A. ACTIVE
Explanation The decode( ) function is used as a “case” statement, where Oracle
will nest through the value in the column identified in the first parameter (in this
case ACCTNO). If that value equals the second parameter, the third parameter is
returned. If that value equals the fourth parameter, the fifth parameter will be returned,
and so on. If the value equals no parameter, the default value provided in the last
parameter (in this case ACTIVE) is returned. TRANSFER would be returned if
ACCTNO=590395, SEIZED would be returned if ACCTNO=654321, and CLOSED
would be returned if ACCTNO=123456. (Topic 4.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:57 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:70
15. B. 28-APR-07
Explanation On this question, you really have to put your thinking cap on.
ADD_MONTHS adds a specified number of months indicated by the second
parameter to the value in the first parameter; 120 months is 10 years, so if you add
10 to the year in the date given you should come up with 28-APR-07, which is the
correct answer. Important Point: beware of having too much of your time sucked
up by this sort of “brain teaser” question. (Topic 4.2)
18. B. All values in the referenced column in the parent table must be present
in the referencing column in the child.
Explanation Referential integrity is from child to parent, not vice versa. The parent
table can have many values that are not present in child records, but the child
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:57 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:71
record must correspond to something in the parent. Thus, the correct answer is all
values in the referenced column in the parent table must be present in the
referencing column in the child. (Topic 12.1)
19. B. sqrt( )
Explanation All the choices indicate group by functions, except for the sqrt( )
function, which is a single-row function acting on each value in each column row,
one at a time or individually. avg( ) processes data from multiple rows in a
column and produces one result, the average value for all of them. count( )
processes all values in a column or columns and counts the number of row values
in that column or columns. The stddev( ) function takes all values in a column
of rows and determines the standard deviation for that set of values. (Topic 6.1)
20. C. nvl( ) returns NULL if the first value is not equal to the second.
Explanation The only statement in this question that is not true is nvl( ) returns
NULL if the first value is not equal to the second. nvl( ) is specifically designed to
avoid returning NULL for a column, by substituting another value that you pass as
the second parameter. All other statements made in these choices are true about
nvl( )—it handles many different datatypes, and both values passed must be the
same datatype. (Topic 4.1)
21. A. Records
Explanation %rowtype is a special keyword in PL/SQL that allows you to define a
record that conforms to the datatypes for rows in a particular table, as in EMP%rowtype
for a set of datatypes in a row from the EMP table. Although that row may contain
columns of VARCHAR2 or NUMBER datatype, a record datatype is a more accurate
way to describe this feature. However, because PLS_INTEGER data cannot be stored
in Oracle tables, you will never see this datatype in a %rowtype record. (Topic 21.2)
22. B. 418
Explanation The key here is being able to distinguish between CURRVAL and
NEXTVAL. Only NEXTVAL will actually change the sequence value. CURRVAL only
selects the current value, so you can factor out the four people who have issued
statements requesting CURRVAL and pay attention only to those users requesting
NEXTVAL. There are two of those, so the sequence, which started at 394, has been
incremented twice by 12. 394 + 12 +12 = 418. (Topic 15.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:57 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:72
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:58 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:73
28. D. INTEGER
Explanation Although you can declare variables in PL/SQL blocks using the INTEGER
datatype, you cannot store INTEGER datatype data in Oracle tables. All other datatypes
shown, namely CHAR, RAW, and DATE, can all be stored in the Oracle database, as
well as being used as datatypes for PL/SQL variables. (Topic 11.3)
29. B. TO_CHAR
Explanation TO_CHAR is used to convert DATE values, numbers, and other things
into text strings. The CONVERT operation is used to convert a text string from one
character set to another, while the TO_NUMBER operation converts numeric text to
true numbers. The TO_DATE function is used to convert a properly formatted text
string into a DATE value. (Topic 4.3)
32. A. too_many_rows
Explanation The answer to this question is too_many_rows, an Oracle predefined
exception that gets raised automatically in the situation described in the question.
The others exception is a catchall that handles any exception that would otherwise
go unhandled at this level of execution. zero_divide is raised automatically
whenever you attempt to divide by 0. Finally, no_data_found is the conceptual
opposite of the correct answer. (Topic 24.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:58 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:74
36. D. like
Explanation In the situation where you want to use wildcards, Oracle offers the
like comparison operator. This operator allows you to search for text strings like
the one you’re looking for. The in operator specifies a set of values to which the
comparison value can be equal to one of, while exists allows you to use a
subquery as a lookup validity test for some piece of information. between specifies
a range comparison, such as between 1 AND 5. (Topic 3.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:58 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:75
40. C. 4104930504
Explanation The only record that will not be present from the choices given is
4104930504, because UPC code #402392340 does not exist at the time this
statement is issued. It was already changed to 50393950, and thus the 4104930504
update fails when you issue it. As an aside, this question is really tricky because in
order to get the answer right you have to read the question for a long time, and that
wastes time when you’re taking the OCP exams. Important Note: This question will
take up an enormous amount of time if you’re not careful. (Topic 10.5)
42. C. 4
Explanation The general rule of thumb here is that, if you have n tables you want
to join, four in this case, you will generally need n − 1 comparison operations in your
where clause joined together by AND—three in this case. In addition, recall from
the question that you want to restrict return data further based on values in the first
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:58 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:76
table. Thus, your where clause would have four conditions, and may look something
like the following block:
WHERE
A.COLUMN1 = 5 AND
A.COLUMN1 = B.COLUMN1 AND
B.COLUMN2 = C.COLUMN2 AND
C.COLUMN3 = D.COLUMN3
(Topic 5.1)
45. C. spool
Explanation The spool command makes SQL*Plus write an output file containing
all information transacted in the session, from the time you turn spooling on and
identify the output file to the time you either turn spooling off or end the session.
prompt causes SQL*Plus to prompt you to enter data using a specialized request
message of your own devising, while echo causes an error because it is not a
valid command in SQL*Plus. Finally, the define command is used for variable
definition and variable assignment in SQL*Plus scripts. (Topic 2.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:59 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:77
internal Oracle errors. The exception handler must contain an exception handler
for the named exception. The only area that does not require coding is the execution
section of your code block, because Oracle will automatically raise your named
exception whenever the internal error occurs in code execution. (Topic 24.1)
50. D. Roles
Explanation Roles allow you to group privileges together into one object and grant
the privileges to the user at one time. There are no privileges related to indexes
other than the privilege to access the associated table. Tables and sequences both
require privileges to be granted to a user or role; they do not simplify the act of
privilege management in any way. (Topic 16.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Friday, February 09, 2001 3:04:48 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:78
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:11:59 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:79
helps you reduce the amount of work you need to do to set up a record variable,
but does nothing to reduce the number of cursors you declare. Finally, %notfound
is an implicit cursor attribute that again has nothing to do with how many cursors
you have to declare in your code block. (Topic 23.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:00 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:80
criteria in the where clause that no data satisfies, by returning NO ROWS SELECTED.
This is not an error condition, but you wouldn’t call it a successful search for data,
either, making both those choices incorrect. Finally, select statements never add
data to a table. (Topic 13.3)
3. D. group by COW_NAME;
Explanation The problem with this statement is that not enough leading columns
from the query are referred to in the group by clause. As a result, you will receive
the ORA-00979 (not a group by expression) error. The correct group by clause
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:00 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:81
would read group by FARM_NAME, COW_NAME;. All other areas of the statement
are syntactically and semantically correct. (Topic 6.3)
4. E. Anonymous blocks
Explanation All PL/SQL blocks are blocks that Oracle can store within the database,
except for anonymous blocks. These are compiled and run when you submit them
to Oracle, and then eventually discarded. There is little opportunity for you to reuse the
code unless you store the code as a text file and rerun it in your session. (Topic 17.1)
5. B. mod(CARTON, FILL_STATUS)
Explanation The line containing reference to the mod( ) operation is the one
containing the error. Because this is a single-row function, it cannot be used as the
group by expression in a SQL statement containing the group by expression. The
rest of the statement is correct. If you substituted a grouping expression like sum( ),
avg( ), or count( ), you would have a correct statement. (Topic 6.2)
7. C. L
Explanation The square root of 40 is a fraction between 6 and 7, which rounds up
to 7 according to the algorithm behind the ceil( ) function. This means that the
VAR2 = ‘7’ flag in the elsif will resolve to true. Thus, VAR2 is set to ‘L’, and then
written to the database with the insert statement at the end. Be careful not to waste
time on reviewing all the intricacies of the PL/SQL block provided. (Topic 20.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Friday, February 09, 2001 3:07:28 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:82
PL/SQL fetch statement. Finally, the where NAME = ’LEWIS’; clause is well
constructed. All other lines of code in the block not identified as choices are
syntactically and semantically correct. (Topic 17.4)
11. B. Values must be part of a fixed set defined by create or alter table.
Explanation A CHECK constraint may only use fixed expressions defined when
you create or alter the table with the constraint definition. The reserved words like
SYSDATE and USER, or values from a lookup table are not permitted, making those
answers incorrect. Finally, NULL values in a column are constrained by NOT NULL
constraints, a relatively unsophisticated form of check constraints. (Topic 12.2)
12. C. Table FOOBAR has no primary key, and therefore no index on MOO.
Explanation Because table FOOBAR has no primary key, you cannot obtain data
from it rapidly the way you could if the MOO column was set up as the primary
key, and thus indexed. So, although Oracle not using the primary key is technically
true, the more accurate answer is that the table had no primary key to use, and
therefore no index on MOO. There are no views involved, and the table didn’t
get dropped. (Topic 11.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:01 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:83
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:01 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:84
values identified. When using positional references to populate column data, there
must be values present for every column in the table. Otherwise, the columns that will
be populated should be named explicitly. Choice C is incorrect because when a column
is named for data insert in the insert into clause, a value must definitely be specified
in the values clause. Choice D is incorrect because using the multiple-row insert
option with a select statement is not appropriate in this situation. (Topic 10.2)
19. D. The inserts contain duplicate data due to the reset sequence.
Explanation The correct answer is that the inserts contain duplicate data due to
the reset sequence. When you drop and re-create the sequence from its original code,
you reset the start value for that sequence. Subsequent insert statements will then
attempt to add rows where the value in the primary key is duplicated information.
There is no information about read-only status in the question, so you should
assume that is not the answer. Dropping a sequence does nothing to a table’s
primary key—there is no relationship between the two. Finally, although it is true
that any cached sequence values that existed when the sequence was dropped are
now unusable, this point has little relevance to the question at hand. (Topic 15.2)
20. B. exists
Explanation Only when using the exists statement must you use a correlated
subquery. Although you can use a subquery with your use of in, you are not
required to do so because you can specify a set of values instead. The between
keyword indicates a range of values and does not allow use of a subquery. The
like keyword is used for wildcard comparisons and also does not allow use of
a subquery. (Topic 7.2)
21. D. abs( )
Explanation All functions except for abs( ) will give you a result of 4093 when
you pass them 4093.505. abs( ) returns the absolute value of the number you pass
into the function. round( ) can do it if you also pass in a second parameter
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:02 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:85
defining the precision to which you want to round the function, while trunc( )
will do it with only 4093.505 as input. floor( ) does it too, because it is the
logical opposite of the ceil( ) function. (Topic 4.2)
23. B. truncate
Explanation Once a truncate operation is complete, that’s it—the change is
made and saved. This is because truncate is not a DML operation that can be
performed as part of a transaction. If you want to get the data back after truncating,
you have to recover it. For any other operation listed as a choice in this question,
such as insert, update, and delete statements, Oracle allows you to discard
the changes using the rollback command. (Topic 11.5)
24. A. savepoint
Explanation savepoint operations simply act as logical breakpoints in a transaction.
They do not cause Oracle to save or discard data, but merely act as a breakpoint with
which you can perform partial transaction rollbacks later. All other commands, namely
set transaction and commit, indicate the beginning of a new transaction. Creating
a new session with Oracle implicitly begins a transaction as well. (Topic 10.5)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:02 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:86
into a variable. The cursor looping mechanism itself is fine and does not need to be
rewritten. The exception handler does not need to be defined for the PL/SQL block,
either. Finally, since this is an anonymous block, there
is no concept of “having permission” to execute it—if you submit it, you can
execute it. (Topic 22.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:02 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:87
32. D. ACTIVE
Explanation The decode( ) function acts as a case statement. The first parameter
indicates the column whose values you want decoded. If the value in the column
equals parameter 2, then decode( ) returns parameter 3. If the value in the column
equals parameter 4, decode( ) returns parameter 5, and so on. If the value in the
column doesn’t equal any of the other parameters specified, then decode( )
returns the default value specified as the last parameter. Thus, since the column
value is something not specified for any of the parameters, the returned value
is the default, ACTIVE. (Topic 4.3)
33. B. Tablespaces
Explanation A tablespace, the logical object used for storing database objects like
tables and indexes, maps most directly to a datafile because tablespaces can have one
or many datafiles. Although segments and extents are stored in datafiles, the mapping
is much closer between tablespace and datafile because both are storage containers.
Finally, although both containers are comprised of Oracle blocks, the concept of
Oracle blocks has less meaning at the filesystem level, where the datafile to the OS
will look just like any other file in the host system. (Topic 1.1)
34. B, D, and E. RDBMS defines how to obtain data for you, RDBMS allows
flexibility in changing data relationships, and RDBMS is able to model
relationship other than master/detail.
Explanation A relational database differs from hierarchical databases like IMS in
many ways. First, the RDBMS handles data access methods implicitly within the
engine, shielding users from defining how to access data physically on the machine
(i.e., “open this file, search for this text string,” etc.)—hierarchical systems like IMS
require that you define methods to traverse the master/detail relationships to obtain
information. Both hierarchical databases and RDBMS systems can store data in
master/detail fashion, which eliminates one choice. Also, because hierarchical
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:03 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:88
databases require that you store all data in master/detail format and define the methods
used to access the data, hierarchical databases are less flexible than RDBMS systems
when it comes to changing the way data relates to other data. Finally, RDBMS systems
can model data in relationships other than master/detail. (Topic 1.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:03 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:89
youngest contestant from every country in the table. This multiple-column subquery
is also a multiple-row subquery, but since the defining factor is the fact that two
columns are present, you should focus more on that fact than on the rows being
returned. This fact eliminates choices A and B. The subquery does return multiple
rows, however. You should also be sensitive to the fact that the main query must use
an in clause, not the equals sign (=), making choice D incorrect as well. (Topic 8.1)
39. A. SOO
Explanation The correct answer is SOO because the subquery operation specified
by the in clause ignores NULL values implicitly. Thus, because SOO has no country
defined, that row is not selected as part of the subquery. So, as a result, SOO won’t
show up as having the youngest age for anyone in the results of this query. (Topic 8.2)
40. B. TABLE
Explanation The object being referred to is a table. A table has many columns,
each of which is functionally dependent on the key column. Choice A is incorrect
because a cursor is simply the result of a query, which may or may not have been
against a table, and does not require any kind of storage in a segment. A sequence
is a number generator in Oracle that, again, does not require storage in a segment
other than a dictionary segment, making choice C incorrect. Finally, a view is
similar to a table in that it contains many columns, each of which is functionally
dependent on the key. However, views contain no data needing to be stored in a
segment, so choice D is wrong as well. (Topic 11.1)
41. B. Executable
Explanation The executable section of a PL/SQL block is where the main operation
of the block is written. Thus, any conditional operation such as the one referred to
by the question would be written in the executable section of the PL/SQL block. The
declaration section is used to declare variables, eliminating choice B and choice A.
The exception section is where exception handlers are defined for error
management, eliminating choice D as well. (Topic 17.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:03 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:90
46. C. The nested block must be defined after variables used in the main block.
Explanation In PL/SQL, the rule about nested blocks is that the sub-block must be
defined after the variables, cursors, and constants defined for use in the main block.
Thus, choice C is correct. You can have named subprograms in anonymous blocks
in PL/SQL, thus meaning that choice A is incorrect. There is no requirement in PL/SQL
that variables passed to other blocks must have the same name as the parameter
defined in the sub-block. In fact, there are compelling reasons not to do so. Thus,
choice B is incorrect. The default keyword is used as an alternative to the
assignment operator in PL/SQL for giving a declared variable an initial value,
thus making choice D incorrect as well. (Topic 18.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:04 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:91
48. D. goto
Explanation Of the control structures given, only the goto command allows you
to jump to a different portion of the PL/SQL lock unconditionally. Even the if true
statement, which always executes the block of code contained in the if-then (and
thus, an if-then-else) structure, is not correct because it does not allow you to
jump to a completely different section of code without running any kind of test. For
this reason, choices A and C are incorrect. Finally, choice B is incorrect because a
loop statement simply iterates through a block of code for as many times as
specified by the looping construct. (Topic 20.1)
49. D. NULL
Explanation Because there is no row in the table where the country is Japan,
the select statement returned no value. Thus, the length of VAR1 will be NULL.
Anything evaluated in conjunction with NULL becomes NULL as well, and thus
VAR2 is assigned when the length of VAR1 plus 55 is executed. Thus, choice D
is the correct answer. (Topic 20.4)
51. B.
TYPE cont_rec IS (
NAME VARCHAR2(20),
AGE NUMBER(5),
COUNTRY VARCHAR2(30));
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:04 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:92
Explanation The correct answer, shown as choice B, is correct because the question
asks you to define a user-defined record. This simply means you have to first define
the elements of this record using the type declaration command, then define a
variable as that type. Choice A simply has you declaring stand-alone variables for
each of the elements in the record, which will work correctly but is not a user-defined
record. Choice C is a representation of how to define a record using the %rowtype
attribute, which is the most efficient way to define this record but is not a user-defined
record unto itself. Finally, choice D identifies an invalid command syntax. (Topic 21.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:04 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:93
55. C. Oracle retrieves all records in the CONTESTANT table into the cursor
and locks those rows for update.
Explanation The for update clause allows you to simultaneously collect one
or several rows from a table and place a lock on those rows in the table for change
during the code block. The change will not be made until you issue an update
statement, however, making choice D incorrect. Because Oracle does not try to
update the statement, choice A is incorrect, too. It is important to remember that
the for update clause also locks rows from the original table, or else the cursor
would simply select all the data and choice B would be correct. (Topic 24.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:05 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:94
until an exception handler is identified or until the error is returned to the user level.
However, Oracle will not return an error to the user level automatically in any
situation—it will always attempt to identify an exception handler first. (Topic 24.5)
60. D. All exit conditions for while loops are handled in the exit
when clause.
Explanation There is no need for an exit statement in a while loop, since the
exiting condition is defined in the while statement, eliminating choice A. Choice B
is also wrong because you don’t specifically need to use a counter in a while loop
the way you do in a for loop. Finally, choice C is incorrect because even though
the exit condition for a while loop evaluates to a Boolean value (for example, exit
when (this_condition_is_true), the mechanism to handle the exit does not
require an explicit IF-THEN statement. (Topic 20.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:05 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:95
2. B. cube
Explanation The cube keyword included in a group by clause of SQL statements
in Oracle8i allows you to perform N-dimensional cross-tabulations within the Oracle
database, returning the result set directly to the client with ease. This keyword is
useful in queries within data warehouses and makes choice B correct. Choice C is
incorrect because even though the rollup keyword was also added to SQL queries
in Oracle8i, this keyword supports subtotal and grand total calculations of grouped
data. Although the having expression is also available in group operations, choice
A is incorrect because you needn’t define a having clause in order to use either
cube or rollup. Finally, choice D is incorrect because the trim( ) function
combines the abilities of ltrim( ) and rtrim( ). (Topic 6.1)
3. B. group by
Explanation The group by clause is added by Oracle8i within the scope of
summary management implicitly. This allows for query rewrite, and thus enhanced
performance in the data warehouse. The order by clause is not implicitly added,
thus making choice A incorrect. And, though cube and rollup may be used to
add additional information to the output of the grouped query, this information is
not added implicitly by summary management. (Topic 6.1)
4. D. Level hierarchy
Explanation When creating a dimension, two aspects must be defined. First, the
various levels must be defined for the dimension. Second, the hierarchy between
those levels must be defined. cube and rollup operations do not need to be
defined, so choices A and B are incorrect. Also, summary management is not
defined as part of the dimension definition, so choice C is incorrect. (Topic 15.1)
5. D. Nested table
Explanation Oracle recommends that, if individual items in the collection object
must be accessed, you use TABLE; otherwise, use VARRAY. Since you want to access
individual items in the collection object, choice D is correct and choice C is wrong.
Choice A is wrong because although you’ll want to use scalar types in the definition
of the nested table type, the overall type will be a nested table, not scalar. Finally,
choice B is wrong because even though the table type will be user defined, there are
more specific choices available that more accurately reflect the answer. (Topic 21.5)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:05 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:96
6. B. Reverse-key indexes
Explanation A reverse-key index is one where the contents of the indexed column
are reversed. This gives a higher amount of lead-in selectivity than a straight B-tree
index would, because the cardinality of the root node in the B-tree would be low.
This is based on the fact that most records would begin with 1 (recall the question
content if you don’t understand why), whereas the reverse of that key would have
greater cardinality. Be careful of choice A, because although cardinality is high,
choice B gives a better option for performance. Choice C is incorrect because bitmap
indexes are designed for low-cardinality records like status or gender. Finally, choice
D indicates an index type that wouldn’t suit this situation. (Topic 15.1)
7. A. VARCHAR2
Explanation Since the text blocks are within the size limits imposed in Oracle8i
for the VARCHAR2 datatype, it is best to use the scalar type rather than a LOB for
simplicity sake. If the block was larger than 4,000 bytes, you would most likely use
a CLOB, but since the size requirement is less than 4,000 bytes, choice C is incorrect.
You would use a BLOB to store binary large objects, making choice B incorrect.
Finally, the text block is not stored as an external file (you would not use the BFILE
type), making choice D incorrect. (Topic 11.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:06 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:97
11. C. Control will pass to the PL/SQL block caller’s exception handler.
Explanation If the exception raised is not handled locally, PL/SQL will attempt to
handle it at the level of the process that called the PL/SQL block. If the exception is
not handled there, PL/SQL will attempt to keep finding an exception handler that
will resolve the exception. If none is found, the error will be returned to the user.
(Topic 24.5)
12. A. Implicit cursors are used for SQL statements that are not named.
Explanation Implicit cursors are used for all SQL statements except for those
statements that are named. They are never incorporated into cursor for loops,
nor is much care given to using them more or less, which eliminates choices B and
C. They are definitely a feature of Oracle, eliminating choice D. (Topic 22.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:06 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:98
17. D. exit
Explanation Without an exit statement, a simple loop will not stop. Though the
loop and end loop keywords are needed to define the loop, you should assume
these are in place and you are only trying to figure out how to end the loop. The
if-then syntax might be used to determine a test condition for when the loop
execution should terminate, but it is not required in and of itself to end the loop
process execution. (Topic 20.3)
18. B. others
Explanation There is no others exception. The others exception handler handles
all exceptions that may be raised in a PL/SQL block that do not have exception
handlers explicitly defined for them. All other choices identify Oracle predefined
exceptions that are all caught by the others keyword when used in an exception
handler. If there is no specific handler for another named exception, the others
exception handler will handle that exception. (Topic 24.4)
21. D. All exit conditions for while loops are handled in the exit when
clause.
Explanation There is no need for an exit statement in a while loop, since the exiting
condition is defined in the while statement, eliminating choice A. Choice B is also
wrong because you don’t specifically need to use a counter in a while loop the way
you do in a for loop. Finally, choice C is incorrect because even though the exit
condition for a while loop evaluates to a Boolean value (for example, exit when
(this_condition_is_true), the mechanism to handle the exit does not require
an explicit if-then statement. (Topic 20.3)
22. C. L
Explanation The fourth letter in the word “processing” is C, which means that the
portion of the if-then statement where VAR1 = C will be used to determine the
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:06 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:99
value for VAR2 (L in this case). Thus, VAR2 is set to ‘L’, and then written to the
database with the insert statement at the end. Be careful not to waste time on
reviewing all the intricacies of the PL/SQL block provided. (Topic 20.2)
26. C. Columns with high cardinality are handled well by B-tree indexes.
Explanation Columns with low cardinality are the bane of B-tree indexes,
eliminating choice A. Furthermore, bitmap indexes are primarily used for performance
gains on columns with low cardinality, eliminating choice B. The correct answer is C.
(Topic 15.1)
27. D. Drop and re-create the view with references to select more columns.
Explanation Choice A is incorrect because adding columns to the underlying table
will not add columns to the view, but will likely invalidate the view. Choice B is
incorrect because the alter view statement simply recompiles an existing view
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:06 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:100
definition, whereas the real solution here is to change the existing view definition
by dropping and re-creating the view. Choice C is incorrect because a correlated
subquery will likely worsen performance, and underscores the real problem—a
column must be added to the view. (Topic 13.2)
28. C. maxvalue
Explanation The maxvalue option is a valid option for sequence creation.
Choices A and B are both part of the create user statement, while choice D is a
part of a constraint declaration in an alter table or create table statement.
(Topic 15.2)
30. A. references
Explanation The references privilege gives the user the ability to refer back
to your table in order to link to it via a foreign key from his or her table to yours.
Choice B is incorrect because the index privilege allows the user to create an index
on a table, while choice C is incorrect because the select privilege allows users
to query data in your table. Finally, choice D is incorrect because the insert
privilege is only required for allowing the other user to insert data into your table.
(Topic 16.3)
31. A, B, and C.
Explanation Choice D is the only option not available to managing roles. Roles
cannot be granted to synonyms. (Topic 16.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:07 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:101
underlying table that cannot then be selected in the view. The with {admin|grant}
option clauses are used to assign administrative ability to users along with granting
them a privilege. The with security option is a work of fiction—it does not exist
in Oracle. (Topic 16.4)
38. C. ALL_IND_COLUMNS
Explanation This view is the only one listed that provides column positions in an
index. Since primary keys create an index, the index created by the primary key
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:07 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:102
will be listed with all the other indexed data. Choice A is incorrect because no
view exists in Oracle called ALL_PRIMARY_KEYS. Choice B is incorrect because
although USER_CONSTRAINTS lists information about the constraints in a database,
but it does not contain information about the index created by the primary key.
Choice D is incorrect because ALL_TABLES contains no information related to the
position of a column in an index. (Topic 14.2)
39. C. A table named ANIMALS will be created in the ANJU schema with the
same data as the ANIMALS table owned by MASTER.
Explanation This question requires you to look carefully at the create table
statement in the question and to know some things about table creation. First, a table
is always created in the schema of the user who created it. Second, since the create
table as select clause was used, choices B and D are both incorrect because they
identify the table being created as something other than ANIMALS, among other things.
Choice A identifies the schema into which the ANIMALS table will be created as
MASTER, which is incorrect for the reasons just stated. (Topic 11.2)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:07 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:103
43. D. The delete statement will remove all records from the table.
Explanation There is only one effect produced by leaving off the where clause
from any statement that allows one—the requested operation is performed on all
records in the table. (Topic 10.4)
45. A. Locks
Explanation Locks are the mechanisms that prevent more than one user at a time
from making changes to the database. All other options refer to the commands that
are issued to mark the beginning, middle, and end of a transaction. (Topic 10.5)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:08 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:104
48. A. UNIQUE
Explanation Only UNIQUE and PRIMARY KEY constraints require Oracle to
generate an index that supports or enforces the uniqueness of the column values.
Foreign keys do not require this sort of index. CHECK constraints also do not require
an index. Finally, NOT NULL constraints do not require an index either. (Topic 12.1)
49. B. All values in the referenced column in the parent table must be present
in the referencing column in the child.
Explanation Referential integrity is from child to parent, not vice versa. The parent
table can have many values that are not present in child records, but the child record
must correspond to something in the parent. Thus, the correct answer is all values in
the referenced column in the parent table must be present in the referencing column
in the child. (Topic 12.1)
50. B. Values must be part of a fixed set defined by create or alter table
Explanation A CHECK constraint may only use fixed expressions defined when you
create or alter the table with the constraint definition. The reserved words like SYSDATE
and USER, or values from a lookup table, are not permitted, making those answers
incorrect. Finally, NULL values in a column are constrained by NOT NULL constraints,
a relatively unsophisticated form of check constraints. (Topic 11.2)
51. B. sqrt( )
Explanation Square root operations are performed on one column value. (Topic 6.3)
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:08 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:105
54. B and C. Alter the prompt clause of the accept command and enter a
new prompt in the login.sql file.
Explanation Choice D should be eliminated immediately, leaving the user to select
between A, B, and C. Choice A is incorrect because config.ora is a feature associated
with Oracle’s client/server network communications product. Choice C is correct,
because you can use the set sqlprompt command within your login.sql file.
This is a special file Oracle users can incorporate into their use of Oracle that will
automatically configure aspects of the SQL*Plus session, such as the default text
editor, column and NLS data formats, and other items. (Topic 9.5)
55. A and C.
Explanation Choice A details the use of a runtime variable that can be used to
have the user input appropriate search criteria after the statement has begun processing.
Choice C details the use of a subquery that allows the user to select unknown search
criteria from the database using known methods for obtaining the data. Choice B is
incorrect because the statement simply provides a known search criterion; choice D
is incorrect because it provides no search criteria at all. (Topic 9.1)
56. A. Ampersand
Explanation The ampersand (&) character is used by default to define runtime
variables in SQL*Plus. (Topic 9.1)
P:\010Comp\Oracle8\341-4\ch01.vp
Friday, February 09, 2001 3:15:31 PM
ORACLE
Color profile: Generic CMYK printer Series
profile / Oracle8i Certified Professional DBA Practice Exams / Couchman / 3341-4 / Chapter 1
Composite Default screen
Blind Folio 1:106
P:\010Comp\Oracle8\341-4\ch01.vp
Thursday, February 08, 2001 2:12:08 PM