SlideShare uma empresa Scribd logo
1 de 94
Baixar para ler offline
Oracle 1z0-001: Practice Exam
QUESTION NO: 1

The PLAYER table contains these columns:


ID NUMBER(9)
NAME VARCHAR(2)
MANAGER_ID NUMBER(9)


In this instance, managers are players and you need to display a list of players.
Evaluate these two SQL statements:


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.id = p.manager_id;


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.manager_id = p.id;


How will the results differ?

A. Statement 1 will not execute; statement 2 will.
B. The results will be the same, but the display will be different.
C. Statement 1 will execute; statement 2 will not.
D. Statement 1 is self-join; statement 2 is not.

Answer: B



QUESTION NO: 2

Under which situation is it necessary to use an explicit cursor?

A. when a SELECT statement in a PL/SQL block retrieves more than one row
B. when an UPDATE statement in a PL/SQL block has to modify more than one row
C. when a DELETE statement in a PL/SQL block deletes more than one row
D. when any DML or SELECT statement is used in a PL/SQL block

Answer: A



QUESTION NO: 3




                        "Pass Any Exam. Any Time." - Guaranteed                     2
Oracle 1z0-001: Practice Exam
Which statement is true when a DROP TABLE command is executed on a table?

A. Any pending transactions on the table are rolled back.
B. The table structure and its deleted data cannot be rolled back and restored once the DROP
TABLE command is executed.
C. The DROP TABLE command can be executed on a table on which there are pending
transactions.
D. The structure of the table remains in the database, and the data and indexes are deleted.
E. Only a DBA can execute the DROP TABLE command.

Answer: B



QUESTION NO: 4

Which statement about implicit cursors is true?

A. Programmers need to close all the implicit cursors before the end of the PL/SQL program.
B. Programmers can declare implicit cursors by using the CURSOR type in the declaration
section.
C. Implicit cursors are declared implicitly only for DML statements.
D. Implicit cursors are declared implicitly for all the DML and SELECT statements.

Answer: D



QUESTION NO: 5

How would you add a foreign key constraint on the dept_no column in the EMP table, referring to
the id column in the DEPT table?

A. Use the ALTER TABLE command with the ADD clause on the EMP table.
B. Use the ALTER TABLE command with the MODIFY clause on the EMP table.
C. Use the ALTER TABLE command with the ADD clause on the DEPT table.
D. This task cannot be accomplished.
E. Use the ALTER TABLE command with the MODIFY clause on the DEPT table.

Answer: A



QUESTION NO: 6

Evaluate this SQL script:


CREATE ROLE manager;
                      "Pass Any Exam. Any Time." - Guaranteed                                     3
Oracle 1z0-001: Practice Exam
CREATE ROLE clerk;
CREATE ROLE inventory;
CREATE USER scott IDENTIFIED BY tiger;
GRANT inventory TO clerk;
GRANT clerk TO manager;
GRANT inventory TO scott
/


How many roles will user SCOTT have access to?

A. 1
B. 2
C. 0
D. 3

Answer: A



QUESTION NO: 7

You want to display the details of all employees whose last name is Smith, but you are not sure in
which case the last names are stored. Which statement will list all the employees whose last name
is Smith?

A. SELECT lastname, firstname
FROM emp
WHERE LOWER(lastname) = 'smith';
B. SELECT lastname, firstname
FROM emp
WHERE UPPER(lastname) = 'smith';
C. SELECT lastname, firstname
FROM emp
WHERE lastname = 'smith';
D. SELECT lastname, firstname
FROM emp
WHERE lastname = UPPER('smith');

Answer: A



QUESTION NO: 8

You are updating the employee table. Jane has been granted the same privileges as you on the
employee table. You ask Jane to log on to the database to check your work before you issue a

                      "Pass Any Exam. Any Time." - Guaranteed                                   4
Oracle 1z0-001: Practice Exam
COMMIT command. What can Jane do to the employee table?

A. Jane can access the table, but she cannot see your changes and cannot make the same
changes.
B. Jane can access the table and verify your changes.
C. Jane cannot access the table.
D. Jane can access the table, but she cannot see your changes. She can make the changes for
you.

Answer: A



QUESTION NO: 9

Click on the EXHIBIT button and examine the table instance chart for the sales table.


You attempt to change the database with this command:
INSERT INTO sales (purchase_no, customer_id, car_id)
VALUES (1234, 345, 6);


If this statement fails, which condition would explain the failure?




A. The sales table has too many foreign keys.
B. The statement has invalid datatypes.
C. A mandatory column value is missing.
D. This statement does not fail at all.

Answer: C



QUESTION NO: 10

Which statement about SQL is true?

A. Date values are displayed in descending order by default.


                       "Pass Any Exam. Any Time." - Guaranteed                                5
Oracle 1z0-001: Practice Exam
B. Null values are displayed last in ascending sequences.
C. The results are sorted by the first column in the SELECT list if the ORDER BY clause is not
provided.
D. You cannot specify a column alias in an ORDER BY clause.
E. You cannot sort query results by a column that is not included the SELECT list.

Answer: B



QUESTION NO: 11

Evaluate this SQL statement:


SELECTe.id, (.15 * e.salary) + (.25 * e.bonus) + (s.sale_amount * (.15 * e.commission_pct))
FROMemployee e, sale s
WHEREe.id = s.emp_id;


What would happen if you removed all the parentheses from the calculation?

A. The results will be lower.
B. The statement will achieve the same results.
C. The statement will not execute.
D. The results will be higher.

Answer: B



QUESTION NO: 12

Within a PL/SQL loop, you need to test if the current fetch was successful. Which SQL cursor
attribute would you use to accomplish this task?

A. A SQL cursor attribute cannot be used within a PL/SQL loop.
B. This task cannot be accomplished with a SQL cursor attribute.
C. SQL%ROWCOUNT
D. SQL%ISOPEN
E. SQL%FOUND

Answer: E



QUESTION NO: 13

In the declarative section of a PL/SQL block, you created but did not initialize a number variable.
When the block executes, what will be the initial value of the variable?
                        "Pass Any Exam. Any Time." - Guaranteed                                     6
Oracle 1z0-001: Practice Exam
A. The block will not execute because the variable was not initialized.The block will not execute
because the variable was not initialized.
B. 0
C. null
D. It depends on the scale and precision of the variable.

Answer: C



QUESTION NO: 14

Examine the code:


DECLARE
CURSOR emp_cursor IS
SELECT ename, deptno
FROM emp;
emp_rec emp_cursor%ROWTYPE;
BEGIN
OPEN emp_cursor;
LOOP
FETCH emp_cursor
INTO emp_rec;
EXIT WHEN emp_cursor%NOTFOUND;
INSERT INTO temp_emp(name, dno)
VALUES (emp_rec.ename, emp_rec.deptno);
END LOOP;
CLOSE emp_cursor;
END;


Using a cursor FOR loop, which PL/SQL block is equivalent to the above code?

A. DECLARE
CURSOR emp_cursor IS
SELECT ename, deptno
FROM emp;
BEGIN
FOR emp_rec IN emp_cursor LOOP
INSERT INTO temp_emp(name, dno)
VALUES (emp_rec.ename, emp_rec.deptno);
END LOOP;
CLOSE emp_cursor;
END;

                      "Pass Any Exam. Any Time." - Guaranteed                                       7
Oracle 1z0-001: Practice Exam
B. DECLARE
CURSOR emp_cursor IS
SELECT ename, deptno
FROM emp;
BEGIN
FOR emp_rec IN emp_cursor LOOP
INSERT INTO temp_emp(name, dno)
VALUES (emp_rec.ename, emp_rec.deptno);
END LOOP;
END;
C. DECLARE
CURSOR emp_cursor IS
SELECT ename, deptno
FROM emp;
emp_rec emp_cursor%ROWTYPE;
BEGIN
FETCH emp_cursor
INTO emp_rec;
FOR emp_rec IN emp_cursor LOOP
INSERT INTO temp_emp(name, dno)
VALUES (emp_rec.ename, emp_rec.deptno);
END LOOP;
END;
D. DECLARE
CURSOR emp_cursor IS
SELECT ename, deptno
FROM emp;
BEGIN
FOR emp_rec IN emp_cursor LOOP
OPEN emp_cursor;
INSERT INTO temp_emp(name, dno)
VALUES (emp_rec.ename, emp_rec.deptno);
END LOOP;
END;

Answer: B



QUESTION NO: 15

You want to retrieve the employee details from the EMP table and process them in PL/SQL block.
Which type of variable do you create in the PL/SQL block to retrieve all the rows and columns
using a single SELECT statement from the EMP table?
                     "Pass Any Exam. Any Time." - Guaranteed                                 8
Oracle 1z0-001: Practice Exam
A. PL/SQL table of scalars
B. PL/SQL table of records
C. %ROWTYPE variable
D. PL/SQL record

Answer: B



QUESTION NO: 16

Given this executable section of a PL/SQL block:


BEGIN
FOR employee_record IN salary_cursor LOOP
employee_id_table(employee_id) :=
employee_record.last_name;
END LOOP;
CLOSE salary_cursor;
END;


Why does this section cause an error?

A. The cursor does not need to be closed.
B. No FETCH statements were issued.
C. Terminating conditions are missing.
D. The cursor needs to be opened.

Answer: A



QUESTION NO: 17

Evaluate this PL/SQL block:


DECLARE
v_result NUMBER(2);
BEGIN
DELETE
FROM employee
WHERE dept_id IN (10, 20, 30);
v_result := SQL%ROWCOUNT;
COMMIT;
END;


                      "Pass Any Exam. Any Time." - Guaranteed    9
Oracle 1z0-001: Practice Exam
What will be the value of V_RESULT if no rows are deleted?

A. 1
B. NULL
C. 0
D. FALSE
E. TRUE

Answer: C



QUESTION NO: 18

Which SELECT statement displays all the employees who do not have any subordinates?

A. SELECT e.ename
FROM emp e
WHERE e.empno NOT IN (SELECT m.mgr
FROM emp m
WHERE m.mgr IS NOT NULL);
B. SELECT e.ename
FROM emp e
WHERE e.empno IN (SELECT m.mgr
FROM emp m);
C. SELECT e.ename
FROM emp e
WHERE e.mgr IS NOT NULL;
D. SELECT e.ename
FROM emp e
WHERE e.empno NOT IN (SELECT m.mgr
FROM emp m);

Answer: A



QUESTION NO: 19

As a DBA, you have just created a user account for employee Smith by using the CREATE USER
command. Smith should be able to create tables and packages in his schema. Which command
will the DBA need to execute next so that Smith can perform his tasks successfully?

A. GRANT CREATE CONNECT, CREATE TABLE, CREATE PROCEDURE
TO smith;



                     "Pass Any Exam. Any Time." - Guaranteed                            10
Oracle 1z0-001: Practice Exam
B. GRANT CREATE TABLE, CREATE PACKAGE
TO smith;
C. GRANT CREATE TABLE, CREATE PROCEDURE
TO smith;
D. GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE
TO smith;

Answer: D



QUESTION NO: 20

Evaluate this IF statement:
IF v_value > 100 THEN
v_new_value := 2 * v_value;
ELSIF v_value > 200 THEN
v_new_value := 3 * v_value;
ELSIF v_value < 300 THEN
v_new_value := 4 * v_value;
ELSE
v_new_value := 5 * v_value;
END IF;


What would be assigned to V_NEW_VALUE if V_VALUE is 250?

A. 250
B. 1250
C. 750
D. 500
E. 1000

Answer: D



QUESTION NO: 21

Click on the EXHIBIT button and examine the table instance chart for the patient table.


You created the patient_vu view based on id_number and last_name from the patient table. What
is the best way to modify the view to contain only those patients born in 1997?




                      "Pass Any Exam. Any Time." - Guaranteed                              11
Oracle 1z0-001: Practice Exam




A. Drop the patient_vu, then create a new view with a WHERE clause.
B. Replace the view adding a WHERE clause.
C. Drop the patient_vu, then create a new view with a HAVING clause.
D. Use the ALTER command to add a WHERE clause to verify the time.

Answer: B



QUESTION NO: 22

Mr. King is the president of a company. Five managers report to him. All other employees report to
these managers.


Examine the code:
SELECT employee.ename
FROM emp employee
WHERE employee.empno NOT IN
(SELECT manager.mgr
FROM emp manager);
The above statement returns
no rows selected.
as the result. Why?

A. None of the employees has a manager.
B. A NULL value is returned from the subquery.
C. All employees have a manager.
D. NOT IN operator is not allowed in subqueries.

Answer: B



QUESTION NO: 23

Examine the structure of the STUDENT table:


                      "Pass Any Exam. Any Time." - Guaranteed                                  12
Oracle 1z0-001: Practice Exam
Name Null? Type
----------------- ----------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Which statement inserts a new row into the STUDENT table?

A. INSERT INTO student (stud_id, address, graduation)
VALUES (101,'100 Main Street','17-JUN-99');
B. INSERT INTO student (stud_id, address, name, graduation)
VALUES (101,'100 Main Street','Smith','17-JUN-99');
C. INSERT INTO student
VALUES (101,'100 Main Street','17-JUN-99','Smith');
D. INSERT INTO student
VALUES (101,'Smith');
E. INSERT INTO student table
VALUES (101,'Smith','100 Main Street','17-JUN-99');

Answer: B



QUESTION NO: 24

Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?

A. LIKE operator
B. IN operator
C. equal operator
D. greater than or equal to operator
E. BETWEEN x AND y operator

Answer: C



QUESTION NO: 25

You have been granted UPDATE privileges on the last_name column of the employee table.
Which data dictionary view would you query to display the column the privilege was granted on
and the schema that owns the employee table?

A. ALL_TABLES



                          "Pass Any Exam. Any Time." - Guaranteed                               13
Oracle 1z0-001: Practice Exam
B. This information cannot be retrieved from a single data dictionary view.
C. ALL_SOURCE
D. TABLE_PRIVILEGES
E. ALL_COL_PRIVS_RECD
F. ALL_OBJECTS

Answer: E



QUESTION NO: 26

Examine the table structures:


EMP Table
Name Null? Type
------------------------------- ------------- -----------
EMPNO NOT NULL NUMBER(4)
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)


TAX Table
Name Null? Type
------------------------------- -------- -----------
TAXGRADE NUMBER
LOWSAL NUMBER
HIGHSAL NUMBER


You want to create a report that displays the employee details along with the tax category of each
employee. The tax category is determined by comparing the salary of the employee from the EMP
table to the lower and upper salary values in the TAX table.


Which SELECT statement produces the required results?

A. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary IN t.lowsal AND t.highsal;
B. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t

                              "Pass Any Exam. Any Time." - Guaranteed                          14
Oracle 1z0-001: Practice Exam
WHERE e.salary BETWEEN t.lowsal AND t.highsal;
C. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary >= t.lowsal AND <= t.highsal;
D. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary <= t.lowsal AND e.salary >= t.highsal;

Answer: B



QUESTION NO: 27

How do you declare a PL/SQL table of records to hold the rows selected from the EMP table?

A. DECLARE
emp_table IS TABLE OF emp%ROWTYPE;
B. DECLARE
TYPE emp_table_type IS TABLE OF emp%ROWTYPE
INDEX BY BINARY_INTEGER;
emp_table emp_table_type;
C. BEGIN
TYPE emp_table_type IS TABLE OF emp%ROWTYPE;
emp_table emp_table_type;
D. DECLARE
TYPE emp_table_type IS TABLE OF emp%ROWTYPE
INDEX BY WHOLE_NUMBER;
emp_table emp_table_type;

Answer: B



QUESTION NO: 28

Examine the structure of the STUDENT table:


Name Null? Type
------------------ -------------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Graduation column is a foreign key column to the GRADDATE table.
                     "Pass Any Exam. Any Time." - Guaranteed                                 15
Oracle 1z0-001: Practice Exam
Examine the data in the GRADDATE table:


GRADUATION
--------------
20-JAN-1999
12-MAY-1999
19-JAN-2000
25-MAY-2000
13-JAN-2001
29-MAY-2001


Which update statement produces the following error?


ORA-02291: integrity constraint (SYS_C23) violated - parent key not found

A. UPDATE student
SET name = 'Smith',
graduation = '15-AUG-2000'
WHERE stud_id = 101;
B. UPDATE studentD.UPDATE student
SET stud_id = NULL,
address = '100 Main Street'
WHERE graduation = '20-JAN-1999';
C. UPDATE student
SET name = 'Smith',
graduation = '29-MAY-2001'
WHERE stud_id = 101;
D. UPDATE student
SET stud_id = 999,
graduation = '29-MAY-2001'
WHERE stud_id = 101;

Answer: A



QUESTION NO: 29

The EMPLOYEE table contains these columns:
FIRST_NAMEVARCHAR2(25)
COMMISSION NUMBER(3,2)


Evaluate this SQL statement:
SELECT first_name, commission

                      "Pass Any Exam. Any Time." - Guaranteed               16
Oracle 1z0-001: Practice Exam
FROM employee
WHERE commission =
(SELECTcommission
FROMemployee
WHEREUPPER(first_name) = 'SCOTT')


What would cause this statement to fail?

A. Scott has a NULL commission value.
B. There is no employee with the first name Scott.
C. The FIRST_NAME values in the database are in lowercase.
D. Scott has a zero commission value.
E. There is more than one employee with the first name Scott.

Answer: E



QUESTION NO: 30

The EMPLOYEE table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
SALARY NUMBER(7,2)


You need to display the names of employees that earn more than the average salary of all
employees.


Evaluate this SQL statement:
SELECT last_name, first_name
FROMemployee
WHEREsalary > AVG(salary);


Which change should you make to achieve the desired results?

A. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
B. Change the function in the WHERE clause.
C. Move the function to the SELECT clause and add a GROUP BY clause.
D. Use a subquery in the WHERE clause to compare the average salary value.

Answer: D



QUESTION NO: 31


                      "Pass Any Exam. Any Time." - Guaranteed                              17
Oracle 1z0-001: Practice Exam
In which section of a PL/SQL block is a user-defined exception raised?

A. exception handling
B. executable
C. heading
D. declarative

Answer: B



QUESTION NO: 32

You are a user of the PROD database which contains over 1000 tables, and you need to
determine the number of tables you can access. Which data dictionary view could you query to
display this information?

A. DBA_TABLES
B. ALL_OBJECTS
C. USER_OBJECTS
D. DBA_SEGMENTS

Answer: B



QUESTION NO: 33

Using SQL*Plus, you created a user with this command:


CREATE USER jennifer IDENTIFIED BY jbw122;


What should you do to allow the user database access?

A. Grant the user the CREATE SESSION privilege.
B. Use the ALTER USER to assign the user a default profile.
C. Use the ALTER USER command to assign the user a default tablespace.
D. No action is required to give the user database access.

Answer: A



QUESTION NO: 34

The EMPLOYEE table contains these columns:


FIRST_NAME VARCHAR2(25)
                        "Pass Any Exam. Any Time." - Guaranteed                                18
Oracle 1z0-001: Practice Exam
LAST_NAME VARCHAR2(25)


Evaluate these two SQL statements:


1. SELECT CONCAT(first_name, last_name),
LENGTH(CONCAT(first_name, last_name))
FROM employee
WHERE UPPER(last_name) LIKE '%J'
ORUPPER(last_name) LIKE '%K'
ORUPPER(last_name) LIKE '%L';


2. SELECT INITCAP(first_name) || INITCAP(last_name),
LENGTH(last_name) + LENGTH(first_name)
FROM employee
WHERE INITCAP(SUBSTR(last_name, 1, 1)) IN ('J', 'K', 'L');


How will the results differ?

A. The statements will retrieve different data from the database.
B. Statement 1 will execute, but statement 2 will not.
C. Statement 2 will execute, but statement 1 will not.
D. The statements will retrieve the same data from the database, but will display it differently.

Answer: A



QUESTION NO: 35

Which statement is true when writing a cursor FOR loop?

A. You do not explicitly open, fetch or close the cursor within a cursor FOR loop .
B. You must explicitly close the cursor prior to the end of the program.
C. You must explicitly fetch the rows within a cursor FOR loop.
D. You must explicitly declare the record variable that holds the row returned from the cursor.
E. You must explicitly open the cursor prior to the cursor FOR loop.

Answer: A



QUESTION NO: 36

You query the database with this command:


SELECT last_name, first_name

                        "Pass Any Exam. Any Time." - Guaranteed                                     19
Oracle 1z0-001: Practice Exam
FROM employee
WHERE salary IN
(SELECT salary
FROM employee
WHERE dept_no = 3 OR dept_no = 5);


Which values are displayed?

A. last name and first name of only the employees in department number 3 or 5
B. last name and first name of only the employees whose salary falls in the range of salaries from
department 3 or 5
C. last name and first name of all employees except those working in department 3 or 5
D. last name and first name of all employees with the same salary as employees in department 3
or 5

Answer: D



QUESTION NO: 37

You issue this command:


CREATE PUBLIC SYNONYM emp
FOR ed.employee;


Which task has been accomplished?

A. The need to qualify the object name with its schema was eliminated for only you.
B. The need to qualify the object name with its schema has been eliminated for all users.
C. The object can now be accessed by all users.
D. All users were given object privileges to the table.

Answer: B



QUESTION NO: 38

The PRODUCT table contains these columns:
ID NUMBER(9) PK
COST NUMBER(7,2)
SALE_PRICE NUMBER(7,2)


Management has asked you to calculate the net revenue per unit for each product if the cost of
each product is increased by 10% and the sale price of each product is increased by 25%.

                      "Pass Any Exam. Any Time." - Guaranteed                                    20
Oracle 1z0-001: Practice Exam


You issue this SQL statement:


SELECT id, sale_price * 1.25 - cost * 1.10
FROMproduct;


Which conclusion can you draw from the results?

A. The order of the operations in the calculation needs to be changed to achieve the required
results.
B. Only the required results are displayed.
C. The results provide more information than management requested.
D. A function needs to be included in the SELECT statement to achieve the desired results.

Answer: B



QUESTION NO: 39

Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?

A. equal operator
B. LIKE operator
C. IN operator
D. greater than or equal to operator
E. BETWEEN x AND y operator

Answer: A



QUESTION NO: 40

Which statement about multiple column subqueries is true?

A. In a pairwise subquery, the values returned from the subquery are compared individually to the
values in the outer query.
B. A non-pairwise comparison produces a cross product.
C. In a non-pairwise subquery, the values returned from the subquery are compared as a group to
the values in the outer query.
D. A pairwise comparison produces a cross product.

Answer: B




                      "Pass Any Exam. Any Time." - Guaranteed                                   21
Oracle 1z0-001: Practice Exam
QUESTION NO: 41

Examine the structure of the STUDENT table:


Name Null? Type
---------------- ----------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
PHONE NOT NULL VARCHAR2(9)
ADDRESS VARCHAR2(50)
GRADUATION DATE


There are 100 records in the STUDENT table. You need to modify the PHONE column to hold
only numeric values.


Which statement will modify the datatype of the PHONE column?

A. ALTER TABLE student
MODIFY COLUMN phone NUMBER(9);
B. ALTER TABLE student
MODIFY phone NUMBER(9);
C. You cannot modify the datatype of a column if there is data in the column.
D. You cannot modify a VARCHAR2 datatype to a NUMBER datatype for a column.

Answer: C



QUESTION NO: 42

You want to create a cursor that can be used several times in a block, selecting a different active
set each time when it is opened. Which type of cursor do you create?

A. a cursor for each active set
B. a cursor FOR loop
C. a cursor that uses parameters
D. a multiple selection cursor

Answer: C



QUESTION NO: 43

The EMP table contains columns to hold the birth date and hire date of employees. Both of these
columns are defined with DATE as their datatype. You want to insert a row with the details of

                         "Pass Any Exam. Any Time." - Guaranteed                                  22
Oracle 1z0-001: Practice Exam
employee Smith who was born in 1944 and hired in 2004. Which statement will ensure that values
are inserted into the table in the correct century?

A. INSERT INTO EMP(empno, ename, birthdate, hiredate)
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-44','DD-MON-YY'),
TO_DATE('10-JUN-04','DD-MON-YY'));
B. INSERT INTO EMP(empno, ename, birthdate, hiredate)
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-1944','DD-MON-YYYY'),
TO_DATE('10-JUN-04','DD-MON-RR'));
C. INSERT INTO EMP(empno, ename, birthdate, hiredate)
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-44','DD-MON-RR'),
TO_DATE('10-JUN-04','DD-MON-RR'));
D. INSERT INTO EMP(empno, ename, birthdate, hiredate)
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH', '12-DEC-44',
'10-JUN-04');

Answer: B



QUESTION NO: 44

Click on the EXHIBIT button and examine the table instance chart for the employee table.


You need to display the hire_date values in this format:


10 of October 1999.


Which SELECT statement can you use?




A. SELECT hire_date ('fmDD "of" MONTH YYYY') "Date Hired"
FROM employee;
B. SELECT TO_CHAR(hire_date, 'DDspth of MONTH YYYY') "DATE HIRED"
FROM employee;
                    "Pass Any Exam. Any Time." - Guaranteed                                23
Oracle 1z0-001: Practice Exam
C. SELECT hire_date ('DD "of" MONTH YYYY') "Date Hired"
FROM employee;
D. SELECT TO_CHAR(hire_date, 'fmDD "of" Month YYYY') DATEHIRED
FROM employee;

Answer: D



QUESTION NO: 45

You have decided to permanently remove all the data from the STUDENT table, and you need the
table structure in the future. Which single command performs this?

A. DELETE *
FROM student
KEEP STRUCTURE;
B. TRUNCATE TABLE student
KEEP STRUCTURE;
C. DROP TABLE student;
D. DELETE *
FROM student;
E. TRUNCATE TABLE student;

Answer: E



QUESTION NO: 46

Examine the structure of the STUDENT table:


Name Null? Type
------------------ ---------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
PHONE NOT NULL VARCHAR2(9)
ADDRESS VARCHAR2(50)
GRADUATION DATE


There are 100 records in the STUDENT table. You want to change the name of the
GRADUATION column to GRAD_DATE.


Which statement is true?



                          "Pass Any Exam. Any Time." - Guaranteed                        24
Oracle 1z0-001: Practice Exam
A. You cannot rename a column.
B. You use the ALTER TABLE command with the RENAME COLUMN clause to rename the
column.
C. You use the ALTER TABLE command with the MODIFY COLUMN clause to rename the
column.
D. You use the ALTER TABLE command with the MODIFY clause to rename the column.

Answer: A



QUESTION NO: 47

The EMPLOYEE table contains these columns:


LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPT_ID NUMBER(9)


You need to display the names of employees that are not assigned to a department.
Evaluate this SQL statement:


SELECT last_name, first_name
FROM employee
WHEREdept_id = NULL;


Which change should you make to achieve the desired result?

A. Change the operator in the WHERE condition.
B. Create an outer join.
C. Add a second condition to the WHERE condition.
D. Change the column in the WHERE condition.

Answer: A



QUESTION NO: 48

Click on the EXHIBIT button and examine the structure of the BOOK_TITLE, COPY, and
CHECK_OUT tables.


You need to create the BOOKS_AVAILABLE view.


These are the desired results:
1.Include the title of each book.
                         "Pass Any Exam. Any Time." - Guaranteed                     25
Oracle 1z0-001: Practice Exam
2.Include the availability of each book.
3.Order the results by the author.


Evaluate this SQL statement:
CREATE VIEW books_available
AS
SELECT b.title, c.availability
FROMbook_title b, copy c
WHEREb.id = c.title_id
ORDER BY b.author;


What does the statement provide?




A. a syntax error
B. one of the desired results
C. all of the desired results
D. two of the desired results

Answer: A



QUESTION NO: 49

Examine this block of code:


SET SERVEROUTPUT ON
DECLARE
x NUMBER;
v_sal NUMBER;
v_found VARCHAR2(10) := 'TRUE';
BEGIN
x := 1;
v_sal := 1000;
DECLARE
v_found VARCHAR2(10);
y NUMBER;
BEGIN
                  "Pass Any Exam. Any Time." - Guaranteed          26
Oracle 1z0-001: Practice Exam
IF (v_sal > 500) THEN
v_found := 'YES';
END IF;
DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found);
DBMS_OUTPUT.PUT_LINE ('Value of v_sal is '|| v_sal);
y := 20;
END;
DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found);
DBMS_OUTPUT.PUT_LINE ('Value of Y is '|| TO_CHAR(y));
END;
SET SERVEROUTPUT OFF


What is the result of executing this block of code?

A. Value of v_found is YES
Value of v_sal is 1000
Value of v_found is YES
Value of Y is 20
B. Value of v_found is YES
Value of v_sal is 1000
Value of v_found is TRUE
Value of Y is 20
C. PLS-00201: identifier 'Y' must be declared
D. Value of v_found is YES
Value of v_sal is 1000
Value of v_found is TRUE
E. PLS-00201: identifier 'v_sal' must be declared
PLS-00201: identifier 'Y' must be declared

Answer: C



QUESTION NO: 50

Examine the table structures:


EMP Table Name Null? Type
------------------------------- -------- --------
EMPNO NOT NULL NUMBER(4)
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE

                              "Pass Any Exam. Any Time." - Guaranteed       27
Oracle 1z0-001: Practice Exam
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)


TAX Table
Name Null? Type
------------------------------- -------- ---------
TAXGRADE NUMBER
LOWSAL NUMBER
HIGHSAL NUMBER


You want to create a report that displays the employee details along with the tax category of each
employee. The tax category is determined by comparing the salary of the employee from the EMP
table to the lower and upper salary values in the TAX table.


Which SELECT statement produces the required results?

A. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary IN t.lowsal AND t.highsal;
B. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary BETWEEN t.lowsal AND t.highsal;
C. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary >= t.lowsal AND <= t.highsal;
D. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary <= t.lowsal AND e.salary >= t.highsal;

Answer: B



QUESTION NO: 51

Click on the EXHIBIT button and examine the table instance chart for the patient table.


You need to create the patient_id_seq sequence to be used with the patient table's primary key
column. The sequence should begin at 1000, have a maximum value of 999999999, never reuse
any numbers, and increment by 1.


Which statement would you use to complete this task?


                              "Pass Any Exam. Any Time." - Guaranteed                          28
Oracle 1z0-001: Practice Exam




A. CREATE SEQUENCE patient_id_seq
START WITH 1000
MAXVALUE 999999999
STEP BY 1;
B. This task cannot be accomplished.
C. CREATE SEQUENCE patient_id_seq
ON patient (patient_id)
MINVALUE 1000
MAXVALUE 999999999
INCREMENT BY 1
NOCYCLE;
D. CREATE SEQUENCE patient_id_seq
START WITH 1000
MAXVALUE 999999999
NOCYCLE;

Answer: D



QUESTION NO: 52

You attempt to query the database with this command:


SELECT name, salary
FROM employee
WHERE salary =
(SELECT salary
FROM employee
WHERE last_name = 'Wagner' OR dept_no = 233);


Why could this statement cause an error?



                     "Pass Any Exam. Any Time." - Guaranteed    29
Oracle 1z0-001: Practice Exam
A. A single row subquery is used with a multiple row comparison operator.
B. A multiple row subquery is used with a single row comparison operator.
C. Logical operators are not allowed in the WHERE clause.
D. Subqueries are not allowed in the WHERE clause.

Answer: B



QUESTION NO: 53

Which statement shows the view definition of the view EMP_VIEW that is created based on the
table EMP?

A. SELECT text
FROM user_views
WHERE view_name = 'EMP_VIEW';
B. DESCRIBE VIEW emp_view
C. SELECT view_text
FROM my_views
WHERE view_name = 'EMP_VIEW';
D. DESCRIBE emp
E. SELECT view_text
FROM TABLE emp
WHERE view_name = 'EMP_VIEW';

Answer: A



QUESTION NO: 54

Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)

A. The SELECT statement contains a GROUP BY clause.
B. The SELECT statement returns more than one row.
C. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.
D. The SELECT statement does not return a row.
E. The SELECT statement does not have a WHERE clause.

Answer: B,D



QUESTION NO: 55

Examine the code:

                      "Pass Any Exam. Any Time." - Guaranteed                                 30
Oracle 1z0-001: Practice Exam
1 DECLARE
2 i NUMBER := 0;
3 v_date DATE;
4 BEGIN
5 i := i+1;
6 LOOP
7 v_date := v_date + 5;
8 i := i+1;
9 EXIT WHEN i = 5;
10 END LOOP;
11 END;


You have encountered unexpected results when the above block of code is executed. How can
you trace the values of the counter variable I and date variable V_DATE in the SQL*Plus
environment?

A. by inserting the statement
DBMS_OUTPUT.PUT_LINE (i ||' '|| TO_CHAR(v_date));
between lines 8 and 9
B. by setting the SQL*Plus session variable DEBUGGER = TRUE
C. by inserting the statement
DBMS_OUTPUT.PUT_LINE (i, v_date);
between lines 8 and 9
D. by inserting the statement
DBMS_OUTPUT.DEBUG_VAR (i, v_date);
between lines 8 and 9

Answer: A



QUESTION NO: 56

The PRODUCT table contains these columns:
ID NUMBER(9) PK
COST NUMBER(7,2)
SALE_PRICE NUMBER(7,2)


Management has asked you to calculate the net revenue per unit for each product if the cost of
each product is increased by 10% and the sale price of each product is increased by 25%.


You issue this SQL statement:


SELECT id, sale_price * 1.25 - cost * 1.10

                      "Pass Any Exam. Any Time." - Guaranteed                                    31
Oracle 1z0-001: Practice Exam
FROM product;


Which conclusion can you draw from the results?

A. A function needs to be included in the SELECT statement to achieve the desired results.
B. The order of the operations in the calculation needs to be changed to achieve the required
results.
C. The results provide more information than management requested.
D. Only the required results are displayed.

Answer: D



QUESTION NO: 57

Which statement would you use to add a primary key constraint to the patient table using the
id_number column, immediately enabling the constraint?

A. ALTER TABLE patient
ADD (id_number CONSTRAINT pat_id_pk PRIMARY KEY);
B. ALTER TABLE patient
MODIFY (id_number CONSTRAINT pat_id_pk PRIMARY KEY);
C. This task cannot be accomplished.
D. ALTER TABLE patient
ADD CONSTRAINT pat_id_pk PRIMARY KEY(id_number);

Answer: D



QUESTION NO: 58

You need to analyze how long your orders take to be shipped from the date that the order is
placed. To do this, you must create a report that displays the customer number, date ordered, date
shipped, and the number of months in whole numbers from the time the order is placed to the time
the order is shipped. Which statement produces the required results?

A. SELECT custid, orderdate, shipdate,
ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken"
FROM ord;
B. SELECT custid, orderdate, shipdate,
ROUNDOFF(shipdate - orderdate) "Time Taken"
FROM ord;
C. SELECT custid, orderdate, shipdate,
MONTHS_BETWEEN (shipdate, orderdate)"Time Taken"

                      "Pass Any Exam. Any Time." - Guaranteed                                   32
Oracle 1z0-001: Practice Exam
FROM ord;
D. SELECT custid, orderdate, shipdate,
ROUND(MONTHS_BETWEEN (shipdate, orderdate))
"Time Taken"
FROM ord;

Answer: D



QUESTION NO: 59

In which situation should you use an outer join query?

A. The employee table column corresponding to the region table column contains null values for
rows that need to be displayed.
B. The employee table has two columns that correspond.
C. The employee and region tables have corresponding columns.
D. The employee and region tables have no corresponding columns.

Answer: A



QUESTION NO: 60

Evaluate this IF statement:
IF v_value > 100 THEN
v_new_value := 2 * v_value;
ELSIF v_value > 200 THEN
v_new_value := 3 * v_value;
ELSIF v_value < 300 THEN
v_new_value := 4 * v_value;
ELSE
v_new_value := 5 * v_value;
END IF;


What would be assigned to V_NEW_VALUE if V_VALUE is 250?

A. 500
B. 750
C. 250
D. 1000
E. 1250




                      "Pass Any Exam. Any Time." - Guaranteed                                33
Oracle 1z0-001: Practice Exam
Answer: A



QUESTION NO: 61

Evaluate this SQL script:


CREATE ROLE manager;
CREATE ROLE clerk;
CREATE ROLE inventory;
CREATE USER scott IDENTIFIED BY tiger;
GRANT inventory TO clerk;
GRANT clerk TO manager;
GRANT inventory TO scott
/


How many roles will user SCOTT have access to?

A. 3
B. 1
C. 0
D. 2

Answer: B



QUESTION NO: 62

Which is NOT an SQL*Plus command?

A. DESCRIBE
B. CHANGE
C. LIST
D. UPDATE
E. ACCEPT

Answer: D



QUESTION NO: 63

You attempt to query the database with this command:


SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date))

                      "Pass Any Exam. Any Time." - Guaranteed   34
Oracle 1z0-001: Practice Exam
FROM employee
WHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60
GROUP BY dept_no
ORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date));


Why does this statement cause an error?

A. A SELECT clause cannot contain a group function.
B. An ORDER BY clause cannot contain a group function.
C. A group function cannot contain a single row function.
D. A WHERE clause cannot be used to restrict groups.

Answer: D



QUESTION NO: 64

The EMPLOYEE table contains these columns:
ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
COMMISSION NUMBER(7,2)


You need to display the current commission for all employees.
These are the desired results:


1.Display the commission multiplied by 1.5.
2.Exclude employees with a zero commission.
3.Display a zero for employees with a null commission value.


Evaluate this SQL command:


SELECT id, last_name, first_name, commission * 1.5
FROM employee
WHEREcommission <> 0;


What does the statement provide?

A. one of the desired results
B. a syntax error
C. all of the desired results
D. two of the desired results



                       "Pass Any Exam. Any Time." - Guaranteed   35
Oracle 1z0-001: Practice Exam
Answer: D



QUESTION NO: 65

You issue this command:


CREATE SYNONYM emp
FOR ed.employee;


Which task has been accomplished?

A. The need to qualify an object name with its schema was eliminated for all users.
B. The need to qualify an object name with its schema was eliminated for user Ed.
C. The need to qualify an object name with its schema was eliminated for only you.
D. The need to qualify an object name with its schema was eliminated for users with access.

Answer: C



QUESTION NO: 66

Evaluate this SQL script:


CREATE ROLE manager;
CREATE ROLE clerk;
CREATE ROLE inventory;
CREATE USER scott IDENTIFIED BY tiger;
GRANT inventory TO clerk;
GRANT clerk TO manager;
GRANT inventory TO scott
/


How many roles will user SCOTT have access to?

A. 2
B. 3
C. 0
D. 1

Answer: D




                      "Pass Any Exam. Any Time." - Guaranteed                                 36
Oracle 1z0-001: Practice Exam
QUESTION NO: 67

Evaluate this PL/SQL block:


BEGIN
FOR i IN 1..5 LOOP
IF i = 1 THEN null;
ELSIF i = 3 THEN COMMIT;
ELSIF i = 5 THEN ROLLBACK;
ELSE INSERT INTO test(results)
VALUES(i);
END IF;
END LOOP;
COMMIT;
END;


How many values will be permanently inserted into the TEST table?

A. 2
B. 1
C. 5
D. 0
E. 6
F. 3

Answer: B



QUESTION NO: 68

You need to store currency data and you know that the data will always have two digits to the right
of the decimal point. However, the number of digits to the left of the decimal place will vary greatly.
Which datatype would be most appropriate to store this data?

A. LONG
B. NUMBER
C. LONG RAW
D. NUMBER(p)

Answer: B



QUESTION NO: 69


                       "Pass Any Exam. Any Time." - Guaranteed                                      37
Oracle 1z0-001: Practice Exam
Examine the structure of the STUDENT table:


Name Null? Type
------------- ----------------- -------------
STUD_ID NOT NULL NUMBER(3)
NAME VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Currently, the table is empty. You have decided that NULL values should not be allowed for NAME
column.


Which statement restricts NULL values from being entered into the column?

A. ALTER TABLE student
ADD CONSTRAINT name(NOT NULL);
B. ALTER TABLE student
ADD CONSTRAINT NOT NULL(name);
C. ALTER TABLE student
MODIFY (name varchar2(25) NOT NULL);
D. ALTER TABLE student
MODIFY CONSTRAINT name(NOT NULL);

Answer: C



QUESTION NO: 70

Evaluate this PL/SQL block:


BEGIN
FOR i IN 1..10 LOOP
IF i = 4 OR i = 6 THEN
null;
ELSE
INSERT INTO test(results)
VALUES (I);
END IF;
COMMIT;
END LOOP;
ROLLBACK;
END;


                             "Pass Any Exam. Any Time." - Guaranteed                        38
Oracle 1z0-001: Practice Exam
How many values will be inserted into the TEST table?

A. 4
B. 8
C. 0
D. 10
E. 6

Answer: B



QUESTION NO: 71

You attempt to create the salary table with this command:


1.CREATE TABLE salary
2.(employee_idNUMBER(9)
3.CONSTRAINT salary_pk PRIMARY KEY,
4.1995_salaryNUMBER(8,2),
5.manager_nameVARCHAR2(25)
6.CONSTRAINT mgr_name_nn NOT NULL,
7.$salary_96NUMBER(8,2));


Which two lines of this statement will return errors? (Choose two.)

A. 4
B. 5
C. 7
D. 3
E. 2
F. 1

Answer: A,C



QUESTION NO: 72

Which statement about using a subquery in the FROM clause is true?

A. You define a data source for future SELECT statements when using a subquery in the FROM
clause.
B. You eliminate the need to create a new view or table by placing a subquery in the FROM
clause.



                      "Pass Any Exam. Any Time." - Guaranteed                            39
Oracle 1z0-001: Practice Exam
C. You eliminate the need to grant SELECT privileges on the table used in the FROM clause
subquery.
D. You cannot use a subquery in the FROM clause.

Answer: B



QUESTION NO: 73

In which order does the Oracle Server evaluate clauses?

A. WHERE, GROUP BY, HAVING
B. WHERE, HAVING, GROUP BY
C. HAVING, WHERE, GROUP BY
D. GROUP BY, HAVING, WHERE

Answer: A



QUESTION NO: 74

You need to change the job title 'Clerk' to 'Administrative Clerk' for all clerks. Which statement
does this?

A. UPDATE emp
SET VALUES job = 'Administrative Clerk'
WHERE UPPER(job) = 'CLERK';
B. UPDATE emp
SET job = 'Administrative Clerk';
C. UPDATE emp
job := 'Administrative Clerk'
WHERE UPPER(job) = 'CLERK';
D. UPDATE emp
SET job = 'Administrative Clerk'
WHERE UPPER(job) = 'CLERK';

Answer: D



QUESTION NO: 75

Examine the structure of the STUDENT table:


Name Null? Type
----------------- ------------- ------------
                              "Pass Any Exam. Any Time." - Guaranteed                                40
Oracle 1z0-001: Practice Exam
STUD_ID NOT NULL NUMBER(3)
NAME VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Currently, the table is empty. You have decided that NULL values should not be allowed for NAME
column.


Which statement restricts NULL values from being entered into the column?

A. ALTER TABLE student
MODIFY (name varchar2(25) NOT NULL);
B. ALTER TABLE student
ADD CONSTRAINT name(NOT NULL);
C. ALTER TABLE student
ADD CONSTRAINT NOT NULL(name);
D. ALTER TABLE student
MODIFY CONSTRAINT name(NOT NULL);

Answer: A



QUESTION NO: 76

Click on the EXHIBIT button and examine the table instance chart for the cars table.


You query the database with this command:


SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available"
FROM cars
WHERE model = 'Fire'
GROUP BY lot_no
HAVING COUNT(*) > 10
ORDER BY COUNT(*);


Which clause restricts which groups are displayed?




                      "Pass Any Exam. Any Time." - Guaranteed                               41
Oracle 1z0-001: Practice Exam




A. HAVING COUNT(*) > 10
B. WHERE model = 'Fire'
C. GROUP BY lot_no
D. ORDER BY COUNT(*)
E. SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available"

Answer: A



QUESTION NO: 77

Which privilege concerns system level security?

A. DROP ANY TABLE
B. INDEX
C. DELETE
D. UPDATE
E. ALTER

Answer: A



QUESTION NO: 78

Which statement is valid within the executable section of a PL/SQL block?

A. WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE ('No records found');
B. SELECT ename, sal
INTO v_ename, v_sal
FROM emp
WHERE empno = 101;
C. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) IS
BEGIN
IF n1 > n2 THEN
                      "Pass Any Exam. Any Time." - Guaranteed               42
Oracle 1z0-001: Practice Exam
p_max := n1;
ELSE
p_max := n2;
END;
D. BEGIN
emp_rec emp%ROWTYPE;
END;

Answer: B



QUESTION NO: 79

A DBA has updated Smith's account by adding the privileges CREATE ANY TABLE and CREATE
PROCEDURE. Which tasks can Smith successfully perform?

A. Smith can create a table in any schema of the database but can drop tables from and create
procedures only in his schema.
B. Smith can create any table or procedure only in his schema. Also, he can drop any table only
from his schema.
C. Smith can create tables, drop tables and create procedures in any schema of the database.
D. Smith can create a table or a procedure in any schema of the database. Also, he can drop a
table in any schema of the database.

Answer: A



QUESTION NO: 80

Which script would you use to query the data dictionary to view only the name of the primary key
constraints by using a substitution parameter for the table name?

A. ACCEPT table PROMPT 'Table to view primary key constraint: '
SELECT constraint_name
FROM user_constraints
WHERE table_name = UPPER('&table') AND constraint_type = 'PRIMARY';
B. ACCEPT table PROMPT 'Table to view primary key constraint: '
SELECT constraint_name
FROM user_cons_columns
WHERE table_name = UPPER('&table') AND constraint_type = 'P';
C. ACCEPT table PROMPT 'Table to view primary key constraint: '
SELECT constraint_name, constraint_type
FROM user_constraints
WHERE table_name = UPPER('&table');

                      "Pass Any Exam. Any Time." - Guaranteed                                     43
Oracle 1z0-001: Practice Exam
D. ACCEPT table PROMPT 'Table to view primary key constraint: '
SELECT constraint_name
FROM user_constraints
WHERE table_name = UPPER('&table') AND constraint_type = 'P';

Answer: D



QUESTION NO: 81

The EMPLOYEE table contains these columns:
ID NUMBER(9) PK
LAST_NAME VARCHAR2(25)NN
DEPT_ID NUMBER(9)


Evaluate this SQL script:
DEFINE id_2 = 93004
SELECT *
FROMemployee
WHEREid = (&id_2)
/


Which change should you make to the script so that it will execute?

A. Remove the ampersand.
B. Use the ACCEPT command.
C. Add single quotation marks.
D. No change is needed.

Answer: D



QUESTION NO: 82

Which ALTER command would you use to reinstate a disabled primary key constraint?

A. ALTER TABLE cars
ENABLE CONSTRAINT cars_id_pk;
B. ALTER TABLE cars
ADD CONSTRAINT cars_id_pk PRIMARY KEY (id);
C. ALTER TABLE cars
ENABLE PRIMARY KEY (id) CASCADE;
D. ALTER TABLE cars
ENABLE PRIMARY KEY (id);

                      "Pass Any Exam. Any Time." - Guaranteed                       44
Oracle 1z0-001: Practice Exam
Answer: A



QUESTION NO: 83

You need to retrieve the employee names and salaries from your EMP table sorted by salary in
descending order. If two names match for a salary, the names must be displayed in alphabetical
order. Which statement produces the required results?

A. SELECT ename, sal
FROM EMP
ORDER BY ename, sal;
B. SELECT ename, sal
FROM EMP
ORDER BY sal DESC, ename ASCENDING;
C. SELECT ename, sal
FROM EMP
ORDER BY sal, ename;
D. SELECT ename, sal
FROM EMP
ORDER BY sal DESC, ename;
E. SELECT ename, sal
FROM EMP
SORT BY sal DESC, ename;

Answer: D



QUESTION NO: 84

The EMPLOYEE table contains these columns:
FIRST_NAMEVARCHAR2(25)
COMMISSION NUMBER(3,2)



Evaluate this SQL statement:
SELECT first_name, commission
FROM employee
WHERE commission =
(SELECTcommission
FROMemployee
WHEREUPPER(first_name) = 'SCOTT')



                      "Pass Any Exam. Any Time." - Guaranteed                                45
Oracle 1z0-001: Practice Exam
What would cause this statement to fail?

A. There is more than one employee with the first name Scott.
B. The FIRST_NAME values in the database are in lowercase.
C. Scott has a NULL commission value.
D. Scott has a zero commission value.
E. There is no employee with the first name Scott.

Answer: A



QUESTION NO: 85

In SQL*Plus, you issued this command:
DELETE FROM dept
WHERE dept_id = 901;


You received an integrity constraint error because a child record was found. What could you do to
make the statement execute?

A. Add the CONSTRAINTS CASCADE option to the command.
B. Add the FORCE keyword to the command.
C. You cannot make the command execute.
D. Delete the child records first.

Answer: D



QUESTION NO: 86

You want to create a report to show different jobs in each department. You do not want to display
any duplicate rows in the report. Which SELECT statement do you use to create the report?

A. SELECT deptno, job
FROM EMP;
B. SELECT NODUPLICATE deptno, job
FROM EMP;
C. SELECT DISTINCT deptno, job
FROM EMP;
D. CREATE REPORT
DISPLAY deptno, job
FROM EMP;
E. SELECT DISTINCT deptno, DISTINCT job
FROM EMP;

                      "Pass Any Exam. Any Time." - Guaranteed                                  46
Oracle 1z0-001: Practice Exam
Answer: C



QUESTION NO: 87

Which should you do after each FETCH statement in a PL/SQL block?

A. Open the cursor.
B. Initialize the loop.
C. Close the cursor.
D. Test for rows using a cursor attribute.

Answer: D



QUESTION NO: 88

Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE
tables.


Evaluate this SQL statement:


CREATE INDEX emp_dept_id_idx
ON employee(dept_id);


Which result will the statement provide?




A. Increase the chance of full table scans.
B. May reduce the amount of disk I/O for SELECT statements.
C. May reduce the amount of disk I/O for INSERT statements.
D. Store an index in the EMPLOYEE table.
E. Override the unique index created when the FK relationship was defined.

Answer: B



                       "Pass Any Exam. Any Time." - Guaranteed                         47
Oracle 1z0-001: Practice Exam
QUESTION NO: 89

Your company wants to give each employee a $100 salary increment. You need to evaluate the
results from the EMP table prior to the actual modification. If you do not want to store the results in
the database, which statement is valid?

A. You need to give the arithmetic expression that involves the salary increment in the UPDATE
clause of the SELECT statement.
B. You need to give the arithmetic expression that involves the salary increment in the SET clause
of the UPDATE statement.
C. You need to add a column to the EMP table.
D. You need to give the arithmetic expression that involves the salary increment in the SELECT
clause of the SELECT statement.
E. You need to give the arithmetic expression that involves the salary increment in the DISPLAY
clause of the SELECT statement.

Answer: D



QUESTION NO: 90

Click on the EXHIBIT button and examine the table instance chart for the patient table.


You created the patient_vu view based on id_number and last_name from the patient table. What
is the best way to modify the view to contain only those patients born in 1997?




A. Replace the view adding a WHERE clause.
B. Drop the patient_vu, then create a new view with a HAVING clause.
C. Drop the patient_vu, then create a new view with a WHERE clause.
D. Use the ALTER command to add a WHERE clause to verify the time.

Answer: A



QUESTION NO: 91




                       "Pass Any Exam. Any Time." - Guaranteed                                      48
Oracle 1z0-001: Practice Exam
Examine the structure of the STUDENT table:


Name Null? Type
------------- ----------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Graduation column is a foreign key column to the GRADDATE table.
Examine the data in the GRADDATE table:


GRADUATION
--------------
20-JAN-1999
12-MAY-1999
19-JAN-2000
25-MAY-2000
13-JAN-2001
29-MAY-2001


Which update statement produces the following error?


ORA-02291: integrity constraint (SYS_C23) violated - parent key not found

A. UPDATE student
SET name = 'Smith',
graduation = '29-MAY-2001'
WHERE stud_id = 101;
B. UPDATE student
SET name = 'Smith',
graduation = '15-AUG-2000'
WHERE stud_id = 101;
C. UPDATE student
SET stud_id = 999,
graduation = '29-MAY-2001'
WHERE stud_id = 101;
D. UPDATE student
SET stud_id = NULL,
address = '100 Main Street'
WHERE graduation = '20-JAN-1999';



                        "Pass Any Exam. Any Time." - Guaranteed             49
Oracle 1z0-001: Practice Exam
Answer: B



QUESTION NO: 92

Examine this block of code:


SET SERVEROUTPUT ON
DECLARE
x NUMBER;
v_sal NUMBER;
v_found VARCHAR2(10) := 'TRUE';
BEGIN
x := 1;
v_sal := 1000;
DECLARE
v_found VARCHAR2(10);
y NUMBER;
BEGIN
IF (v_sal > 500) THEN
v_found := 'YES';
END IF;
DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found);
DBMS_OUTPUT.PUT_LINE ('Value of v_sal is '|| v_sal);
y := 20;
END;
DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found);
DBMS_OUTPUT.PUT_LINE ('Value of Y is '|| TO_CHAR(y));
END;
SET SERVEROUTPUT OFF


Why does this code produce an error when executed?

A. The value of V_FOUND cannot be 'YES'.
B. Variable Y is declared in the inner block and referenced in the outer block.
C. Variable V_FOUND is declared at more than one location.
D. Variable V_SAL is declared in the outer block and referenced in the inner block.

Answer: B



QUESTION NO: 93


                      "Pass Any Exam. Any Time." - Guaranteed                         50
Oracle 1z0-001: Practice Exam
Click on the EXHIBIT button and examine the table instance chart for the employee table.


You want to display each employee's hire date from earliest to latest. Which SQL statement would
you use?




A. SELECT hire_date
FROM employee;
B. SELECT hire_date
FROM employee
ORDER BY hire_date DESC;
C. SELECT hire_date
FROM employee
ORDER BY hire_date;
D. SELECT hire_date
FROM employee
GROUP BY hire_date;

Answer: C



QUESTION NO: 94

In which section of a PL/SQL block is a user-defined exception raised?

A. heading
B. declarative
C. executable
D. exception handling

Answer: C



QUESTION NO: 95

Examine the declaration section:


                        "Pass Any Exam. Any Time." - Guaranteed                              51
Oracle 1z0-001: Practice Exam
DECLARE
CURSOR emp_cursor(p_deptno NUMBER, p_job VARCHAR2)
IS
SELECT empno, ename
FROM emp
WHERE deptno = p_deptno
AND job = p_job;
BEGIN
...


Which statement opens this cursor successfully?

A. OPEN emp_cursor('Clerk', 10);
B. OPEN emp_cursor;
C. OPEN emp_cursor(p_deptno, p_job);
D. OPEN emp_cursor(10,'Analyst');

Answer: D



QUESTION NO: 96

The EMPLOYEE table has ten columns. Since you often query the table with conditions based on
four or more columns, you created an index on all the columns in the table. Which result will
occur?

A. The speed of inserts will be increased.
B. Updates on the table will be slower.
C. The size of the EMPLOYEE table will be increased.
D. All queries on the table will be faster.

Answer: B



QUESTION NO: 97

Which SELECT statement would you use in a PL/SQL block to query the employee table and
retrieve the last name and salary of the employee whose id is 3?

A. SELECT last_name, salary
INTO v_last_name, v_salary
FROM employee
WHERE id = 3;



                     "Pass Any Exam. Any Time." - Guaranteed                               52
Oracle 1z0-001: Practice Exam
B. SELECT last_name, salary
FROM employee
INTO v_last_name, v_salary
WHERE id = 3;
C. SELECT last_name, salary
FROM employee
WHERE id = 3;
D. SELECT last_name, salary
FROM employee;

Answer: A



QUESTION NO: 98

Examine the table structures:


EMP Table Name Null? Type
------------------------------- ----------------- -----------
EMPNO NOT NULL NUMBER(4)
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NOT NULL NUMBER(2)


TAX Table
Name Null? Type
------------------------------- ---------- --------
TAXGRADE NUMBER
LOWSAL NUMBER
HIGHSAL NUMBER


You want to create a report that displays the employee details along with the tax category of each
employee. The tax category is determined by comparing the salary of the employee from the EMP
table to the lower and upper salary values in the TAX table.


Which SELECT statement produces the required results?

A. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t

                              "Pass Any Exam. Any Time." - Guaranteed                          53
Oracle 1z0-001: Practice Exam
WHERE e.salary BETWEEN t.lowsal AND t.highsal;
B. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary <= t.lowsal AND e.salary >= t.highsal;
C. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary IN t.lowsal AND t.highsal;
D. SELECT e.name, e.salary, t.taxgrade
FROM emp e, tax t
WHERE e.salary >= t.lowsal AND <= t.highsal;

Answer: A



QUESTION NO: 99

Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE
tables.


Evaluate this SQL statement:


CREATE INDEX emp_dept_id_idx
ON employee(dept_id);


Which result will the statement provide?




A. May reduce the amount of disk I/O for SELECT statements.
B. May reduce the amount of disk I/O for INSERT statements.
C. Increase the chance of full table scans.
D. Store an index in the EMPLOYEE table.
E. Override the unique index created when the FK relationship was defined.

Answer: A




                      "Pass Any Exam. Any Time." - Guaranteed                          54
Oracle 1z0-001: Practice Exam
QUESTION NO: 100

You attempt to create the salary table with this command:


1.CREATE TABLE salary
2.(employee_idNUMBER(9)
3.CONSTRAINT salary_pk PRIMARY KEY,
4.1995_salaryNUMBER(8,2),
5.manager_nameVARCHAR2(25)
6.CONSTRAINT mgr_name_nn NOT NULL,
7.$salary_96NUMBER(8,2));


Which two lines of this statement will return errors? (Choose two.)

A. 3
B. 2
C. 1
D. 7
E. 4
F. 5

Answer: D,E



QUESTION NO: 101

Click on the EXHIBIT button and examine the table instance chart for the cars table.


Which SELECT statement will display style, color, and lot number for all cars based on the model
entered at the prompt, regardless of case?




A. SELECT style, color, lot_no
FROM cars
WHERE model = '&model';

                      "Pass Any Exam. Any Time." - Guaranteed                                 55
Oracle 1z0-001: Practice Exam
B. SELECT style, color, lot_no
FROM cars
WHERE UPPER(model) = '&model';
C. SELECT style, color, lot_no
FROM cars
WHERE UPPER(model) = UPPER('&model');
D. SELECT style, color, lot_no
FROM cars
WHERE model = UPPER('&model');

Answer: C



QUESTION NO: 102

Examine the structure of the STUDENT table:


Name Null? Type
---------------- -------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Which statement inserts a new row into the STUDENT table?

A. INSERT INTO student
VALUES (101,'Smith');
B. INSERT INTO student (stud_id, address, graduation)
VALUES (101,'100 Main Street','17-JUN-99');
C. INSERT INTO student (stud_id, address, name, graduation)
VALUES (101,'100 Main Street','Smith','17-JUN-99');
D. INSERT INTO student table
VALUES (101,'Smith','100 Main Street','17-JUN-99');
E. INSERT INTO student
VALUES (101,'100 Main Street','17-JUN-99','Smith');

Answer: C



QUESTION NO: 103

You need to store currency data and you know that the data will always have two digits to the right
of the decimal point. However, the number of digits to the left of the decimal place will vary greatly.
                       "Pass Any Exam. Any Time." - Guaranteed                                     56
Oracle 1z0-001: Practice Exam
Which datatype would be most appropriate to store this data?

A. LONG
B. LONG RAW
C. NUMBER(p)
D. NUMBER

Answer: D



QUESTION NO: 104

You need to remove all the data from the employee table while leaving the table definition intact.
You want to be able to undo this operation. How would you accomplish this task?

A. TRUNCATE TABLE employee;
B. DELETE FROM employee;
C. This task cannot be accomplished.
D. DROP TABLE employee;

Answer: B



QUESTION NO: 105

Click on the EXHIBIT button and examine the employee table.


You create a view with this command:
CREATE VIEW dept_salary_vu
AS SELECT dept_no, salary, last_name
FROM employee
WHERE salary > 45000
WITH CHECK OPTION;


For which employee can you update the dept_no column?




                      "Pass Any Exam. Any Time." - Guaranteed                                    57
Oracle 1z0-001: Practice Exam




A. Southall
B. none
C. Chiazza
D. Brown

Answer: C



QUESTION NO: 106

The PLAYER table contains these columns:


ID NUMBER(9)
NAME VARCHAR(2)
MANAGER_ID NUMBER(9)


In this instance, managers are players and you need to display a list of players.
Evaluate these two SQL statements:


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.id = p.manager_id;


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.manager_id = p.id;


How will the results differ?

A. Statement 1 will not execute; statement 2 will.


                        "Pass Any Exam. Any Time." - Guaranteed                     58
Oracle 1z0-001: Practice Exam
B. Statement 1 is self-join; statement 2 is not.
C. Statement 1 will execute; statement 2 will not.
D. The results will be the same, but the display will be different.

Answer: D



QUESTION NO: 107

You attempt to query the database with this command:


SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date))
FROM employee
WHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60
GROUP BY dept_no
ORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date));


Why does this statement cause an error?

A. A SELECT clause cannot contain a group function.
B. An ORDER BY clause cannot contain a group function.
C. A group function cannot contain a single row function.
D. A WHERE clause cannot be used to restrict groups.

Answer: D



QUESTION NO: 108

Evaluate this PL/SQL block:


DECLARE
v_result NUMBER(2);
BEGIN
DELETE
FROM employee
WHERE dept_id IN (10, 20, 30);
v_result := SQL%ROWCOUNT;
COMMIT;
END;


What will be the value of V_RESULT if no rows are deleted?



                       "Pass Any Exam. Any Time." - Guaranteed        59
Oracle 1z0-001: Practice Exam
A. 0
B. NULL
C. FALSE
D. 1
E. TRUE

Answer: A



QUESTION NO: 109

Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)

A. The SELECT statement does not have a WHERE clause.
B. The SELECT statement contains a GROUP BY clause.
C. The SELECT statement does not return a row.
D. The SELECT statement returns more than one row.
E. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.

Answer: C,D



QUESTION NO: 110

The structure of the DEPT table is as follows:


Name Null? Type
------------------------------- -------------- ---------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)


Examine the code:


DECLARE
dept_rec dept%ROWTYPE;
BEGIN
SELECT *
INTO dept_rec
FROM dept
WHERE deptno = 10;
END;


Which PL/SQL statement displays the location of the selected department?
                   "Pass Any Exam. Any Time." - Guaranteed                                    60
Oracle 1z0-001: Practice Exam
A. DBMS_OUTPUT.PUT_LINE (dept_rec.loc);
B. DBMS_OUTPUT.PUT_LINE (dept_rec);
C. You cannot display a single field in the record because they are not explicitly identified in the
declarative section.
D. DBMS_OUTPUT.PUT_LINE (dept_rec(1).loc);

Answer: A



QUESTION NO: 111

Which SELECT statement displays employee names, salaries, department numbers, and average
salaries for all employees who earn more than the average salary in their department?

A. SELECT outer.ename,outer.sal,outer.deptno,AVG(outer.sal)
FROM emp outer
GROUP BY outer.ename, outer.sal, outer.deptno
HAVING AVG(outer.sal) IN
(SELECT inner.sal
FROM emp inner
WHERE inner.deptno = outer.deptno);
B. SELECT outer.ename,outer.sal,
outer.deptno,AVG(outer.sal)
FROM emp outer
GROUP BY outer.ename, outer.sal, outer.deptno
HAVING AVG(outer.sal) >
(SELECT inner.sal
FROM emp inner WHERE inner.deptno = outer.deptno);
C. SELECT ename, sal, deptno, AVG(sal)
FROM emp
GROUP BY ename, sal, deptno;
D. SELECT a.ename, a.sal, a.deptno, b.salavg
FROM emp a, (SELECT deptno, AVG(sal) salavg
FROM emp
GROUP BY deptno) b
WHERE a.deptno = b.deptno
AND a.sal > b.salavg;

Answer: D



QUESTION NO: 112



                       "Pass Any Exam. Any Time." - Guaranteed                                         61
Oracle 1z0-001: Practice Exam
You need to execute a script file named QUERYEMP.SQL from your SQL*Plus environment.
Which command do you use?

A. START QUERYEMP
B. RUN QUERYEMP
C. GET QUERYEMP
D. EXECUTE QUERYEMP

Answer: A



QUESTION NO: 113

You need to create a PL/SQL program to insert records into the employee table. Which block of
code successfully uses the INSERT command?

A. DECLARE
v_hiredate DATE := SYSDATE;
BEGIN
INSERT INTO emp(empno, ename, hiredate, deptno)
(empno_sequence.nextval, '&name', v_hiredate,
&deptno);
END;
B. DECLARE
v_hiredate DATE := SYSDATE;
BEGIN
INSERT INTO emp(empno, ename, hiredate, deptno)
VALUES(empno_sequence.nextval, '&name', v_hiredate,
&deptno);
END;
C. DECLARE
v_hiredate DATE := SYSDATE;
BEGIN
INSERT INTO emp(empno, ename, hiredate, deptno)
VALUES(empno_sequence.nextval, '&name', v_hiredate,
&deptno)
WHERE job = 'CLERK';
END;
D. DECLARE
v_hiredate DATE := SYSDATE;
BEGIN
INSERT INTO emp(empno, ename, hiredate)
VALUES(empno_sequence.nextval, '&name', v_hiredate,

                     "Pass Any Exam. Any Time." - Guaranteed                                    62
Oracle 1z0-001: Practice Exam
&deptno);
END;

Answer: B



QUESTION NO: 114

Which SELECT statement displays the order id, product id, and quantity of items in the ITEM table
that match both the product id and quantity of an item in order 605? (Do not display the details for
order 605.)

A. SELECT ordid, prodid, qty
FROM item
WHERE (prodid, qty) IN
(SELECT prodid, qty
FROM item
WHERE ordid = 605)
AND ordid <> 605;
B. SELECT ordid, prodid, qty
FROM item
WHERE (prodid, qty) =
(SELECT prodid, qty
FROM item
WHERE ordid = 605)
AND ordid <> 605;
C. SELECT ordid, prodid, qty
FROM item
WHERE (prodid, qty) IN
(SELECT prodid, qty
FROM item
WHERE ordid = 605);
D. SELECT ordid, prodid, qty
FROM item
WHERE (prodid, qty) IN
(SELECT ordid, prodid, qty
FROM item
WHERE ordid = 605)
AND ordid <> 605;

Answer: A




                      "Pass Any Exam. Any Time." - Guaranteed                                    63
Oracle 1z0-001: Practice Exam


QUESTION NO: 115

Evaluate this PL/SQL block:


BEGIN
FOR i IN 1..10 LOOP
IF i = 4 OR i = 6 THEN
null;
ELSE
INSERT INTO test(results)
VALUES (I);
END IF;
COMMIT;
END LOOP;
ROLLBACK;
END;


How many values will be inserted into the TEST table?

A. 8
B. 10
C. 4
D. 6
E. 0

Answer: A



QUESTION NO: 116

You create the sale table with this command:


CREATE TABLE sale
(purchase_no NUMBER(9)
CONSTRAINT sale_purchase_no_pk PRIMARY KEY,
customer_id NUMBER(9)
CONSTRAINT sale_customer_id_fk REFERENCES customer (id)
CONSTRAINT sale_customer_id_nn NOT NULL);


Which index or indexes are created for this table?

A. No indexes are created for this table.


                       "Pass Any Exam. Any Time." - Guaranteed    64
Oracle 1z0-001: Practice Exam
B. An index is created for each column.
C. An index is created for the customer_id column.
D. An index is created for the purchase_no column.

Answer: D



QUESTION NO: 117

Click on the EXHIBIT button and examine the table instance chart for the patient table.


You created the patient_id_seq sequence to be used with the patient table's primary key column.
The sequence begins at 1000, has a maximum value of 999999999, and increments by 1. You
need to write a script to insert a row into the patient table and use the sequence you created.
Which script would you use to complete this task?




A. INSERT INTO patient (id_number, last_name, first_name, birth_date)
VALUES (patient_id_seq, last_name, first_name, birth_date)
/
B. INSERT INTO patient (id_number, last_name, first_name, birth_date)
VALUES (patient_id_seq.NEXTVAL, &last_name, &first_name, &birth_date)
/
C. INSERT INTO patient (id_number, last_name, first_name, birth_date)
VALUES (patient_id_seq.NEXTVALUE, &last_name, &first_name, &birth_date)
/
D. INSERT INTO patient (id_number)
VALUES (patient_id_seq.NEXTVALUE)
/
E. This task cannot be accomplished.
F. INSERT INTO patient (id_number, last_name, first_name, birth_date)
VALUES (patient_id_seq.CURRVAL, &last_name, &first_name, &birth_date)
/

Answer: B



                      "Pass Any Exam. Any Time." - Guaranteed                                65
Oracle 1z0-001: Practice Exam
QUESTION NO: 118

How do you send the output of your SQL*Plus session to a text operating system file called
MYOUTPUT.LST?

A. SAVE myoutput.lst
B. SPOOL myoutput.lst
C. PRINT myoutput.lst
D. SENDOUTPUT myoutput.lst

Answer: B



QUESTION NO: 119

You need to analyze how long your orders take to be shipped from the date that the order is
placed. To do this, you must create a report that displays the customer number, date ordered, date
shipped, and the number of months in whole numbers from the time the order is placed to the time
the order is shipped.


Which statement produces the required results?

A. SELECT custid, orderdate, shipdate,
ROUNDOFF(shipdate - orderdate) "Time Taken"
FROM ord;
B. SELECT custid, orderdate, shipdate,
MONTHS_BETWEEN (shipdate, orderdate)"Time Taken"
FROM ord;
C. SELECT custid, orderdate, shipdate,
ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken"
FROM ord;
D. SELECT custid, orderdate, shipdate,
ROUND(MONTHS_BETWEEN (shipdate, orderdate))
"Time Taken"
FROM ord;

Answer: D



QUESTION NO: 120

The EMPLOYEE table contains these columns:


BONUSNUMBER(7,2)

                      "Pass Any Exam. Any Time." - Guaranteed                                  66
Oracle 1z0-001: Practice Exam
DEPT_ID NUMBER(9)


There are 10 departments and each department has at least 1 employee. Bonus values are
greater than 500; not all employees receive a bonus.


Evaluate this PL/SQL block:
DECLARE
v_bonusemployee.bonus%TYPE := 300;
BEGIN
UPDATE employee
SET bonus = bonus + v_bonus
WHERE dept_id IN (10, 20, 30);
COMMIT;
END;


What will be the result?

A. A subset of employees will be given a 300 bonus.
B. All employees will be given a 300 increase in bonus.
C. A subset of employees will be given a 300 increase in bonus.
D. All employees will be given a 300 bonus.

Answer: C



QUESTION NO: 121

The view EMP_VIEW is created based on the table EMP as follows:


CREATE OR REPLACE VIEW emp_view
AS
SELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMP
FROM emp
GROUP BY deptno;


What happens when the following command is issued?


UPDATE emp_view
SET tot_sal = 20000
WHERE deptno = 10;

A. The base table can not be updated through this view.



                       "Pass Any Exam. Any Time." - Guaranteed                           67
Oracle 1z0-001: Practice Exam
B. The SAL column in the EMP table is updated to 20000 for employees in department 10.
C. The TOT_SAL column in EMP table is updated to 20000 for department 10.
D. The TOT_SAL column in EMP_VIEW view is updated to 20000 for department 10.

Answer: A



QUESTION NO: 122

In which order does the Oracle Server evaluate clauses?

A. WHERE, HAVING, GROUP BY
B. HAVING, WHERE, GROUP BY
C. WHERE, GROUP BY, HAVING
D. GROUP BY, HAVING, WHERE

Answer: C



QUESTION NO: 123

Click on the EXHIBIT button and examine the table instance chart for the cars table.


Which SELECT statement will display style, color, and lot number for all cars based on the model
entered at the prompt, regardless of case?




A. SELECT style, color, lot_no
FROM cars
WHERE model = UPPER('&model');
B. SELECT style, color, lot_no
FROM cars
WHERE UPPER(model) = '&model';
C. SELECT style, color, lot_no
FROM cars
WHERE model = '&model';

                      "Pass Any Exam. Any Time." - Guaranteed                                 68
Oracle 1z0-001: Practice Exam
D. SELECT style, color, lot_no
FROM cars
WHERE UPPER(model) = UPPER('&model');

Answer: D



QUESTION NO: 124

Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.


You issue this SQL statement:


SELECT pr.name
FROMpart pt, product pr
WHEREpt.product_id(+) = pr.id;


What is the result?




A. A list of all products is displayed for products with parts.
B. An error is generated.
C. A list of all product names is displayed.
D. A list of products is displayed for parts that have products assigned.

Answer: C



QUESTION NO: 125

The structure of the DEPT table is as follows:


Name Null? Type
------------------------------- ---------- --------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)


Examine the declaration section:

                              "Pass Any Exam. Any Time." - Guaranteed                   69
Oracle 1z0-001: Practice Exam


DECLARE
TYPE dept_table_type IS TABLE OF dept%ROWTYPE
INDEX BY BINARY_INTEGER;
dept_table dept_table_type;


You need to assign the LOC field in record 15, the value of 'Atlanta'. Which PL/SQL statement
makes this assignment?

A. dept_table.loc.15 := 'Atlanta';
B. dept_table(15).loc := 'Atlanta';
C. dept_table[15].loc := 'Atlanta';
D. dept_table_type(15).loc := 'Atlanta';

Answer: B



QUESTION NO: 126

Evaluate these two SQL commands:


1.SELECT DISTINCT object_type
FROM user_objects;
2.SELECTobject_type
FROM all_objects;


How will the results differ?

A. Statement 1 will display the distinct object types owned by the user; statement 2 will display all
the object types the user can access.
B. Statement 1 will display the distinct object types owned by the user; statement 2 will display all
the object types in the database.
C. Statement 1 will display the distinct object types in the database; statement 2 will display all the
object types in the database.
D. Statement 1 will display the distinct object types that the user can access; statement 2 will
display all the object types that the user owns.

Answer: A



QUESTION NO: 127

Which statement is valid within the executable section of a PL/SQL block?


                        "Pass Any Exam. Any Time." - Guaranteed                                     70
Oracle 1z0-001: Practice Exam
A. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) IS
BEGIN
IF n1 > n2 THEN
p_max := n1;
ELSE
p_max := n2;
END;
B. SELECT ename, sal
INTO v_ename, v_sal
FROM emp
WHERE empno = 101;
C. WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE ('No records found');
D. BEGIN
emp_rec emp%ROWTYPE;
END;

Answer: B



QUESTION NO: 128

You want to create a report that gives, per department, the number of employees and total salary
as a percentage of all the departments.


Examine the results from the report:


Department %Employees %Salary
--------------- ---------------- -------------
10 21.43 30.15 2
0 35.71 37.47
30 42.86 32.39


Which SELECT statement produces the report?

A. SELECT deptno "Department",
(COUNT(*)/COUNT(empno)) * 100 "%Employees",
(SUM(sal)/COUNT(*)) * 100 "%Salary"
FROM scott.emp
GROUP BY deptno;
B. SELECT
a.deptno "Department",
ROUND(a.num_emp/b.total_count * 100, 2) "%Employees",

                             "Pass Any Exam. Any Time." - Guaranteed                          71
Oracle 1z0-001: Practice Exam
ROUND(a.sal_sum/b.total_sal * 100, 2) "%Salary"
FROM
(SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sum
FROM scott.emp
GROUP BY deptno) a,
(SELECT COUNT(*) total_count, SUM(sal) total_sal
FROM scott.emp) b;
C. SELECT deptno "Department",
PCT(empno) "%Employees",
PCT(sal) "%Salary"
FROM scott.emp
GROUP BY deptno;
D. SELECT a.deptno "Department",
(a.num_emp/COUNT(*)) * 100 "%Employees",
(a.sal_sum/COUNT(*)) * 100 "%Salary"
FROM
(SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sum
FROM scott.emp
GROUP BY deptno) a;

Answer: B



QUESTION NO: 129

Which privilege concerns system level security?

A. INDEX
B. DROP ANY TABLE
C. DELETE
D. UPDATE
E. ALTER

Answer: B



QUESTION NO: 130

The view EMP_VIEW is created based on the table EMP as follows:


CREATE OR REPLACE VIEW emp_view
AS
SELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMP
FROM emp
                  "Pass Any Exam. Any Time." - Guaranteed         72
Oracle 1z0-001: Practice Exam
GROUP BY deptno;


What happens when the following command is issued?


UPDATE emp_view
SET tot_sal = 20000
WHERE deptno = 10;

A. The SAL column in the EMP table is updated to 20000 for employees in department 10.
B. The TOT_SAL column in EMP_VIEW view is updated to 20000 for department 10.
C. The TOT_SAL column in EMP table is updated to 20000 for department 10.
D. The base table can not be updated through this view.

Answer: D



QUESTION NO: 131

Click on the EXHIBIT button and examine the table instance chart for the patient table.


You need to create the patient_id_seq sequence to be used with the patient table's primary key
column. The sequence should begin at 1000, have a maximum value of 999999999, never reuse
any numbers, and increment by 1.


Which statement would you use to complete this task?




A. CREATE SEQUENCE patient_id_seq
START WITH 1000
MAXVALUE 999999999
STEP BY 1;
B. This task cannot be accomplished.
C. CREATE SEQUENCE patient_id_seq
ON patient (patient_id)
MINVALUE 1000
MAXVALUE 999999999
INCREMENT BY 1
                      "Pass Any Exam. Any Time." - Guaranteed                                73
Oracle 1z0-001: Practice Exam
NOCYCLE;
D. CREATE SEQUENCE patient_id_seq
START WITH 1000
MAXVALUE 999999999
NOCYCLE;

Answer: D



QUESTION NO: 132

For which three tasks would you use the WHERE clause? (Choose three.)

A. restrict the rows displayed
B. display only data greater than a specified value
C. restrict the output of a group function
D. designate a table location
E. display only unique data
F. compare two values

Answer: A,B,F



QUESTION NO: 133

You have a view called ANN_SAL that is based on the EMPLOYEE table. The structure of the
ANN_SAL view is:


Name Null? Type
------------------------------- -------------- ----------
EMPNO NOT NULL NUMBER(4)
YEARLY_SAL NUMBER(9,2)
MONTHLY_SAL NUMBER(9,2)


Which statement retrieves data from the ANN_SAL view?

A. SELECT *
FROM VIEW ann_sal BASEDON employee;
B. SELECT *
FROM EMPLOYEE;
C. SELECT *
FROM ann_sal;
D. SELECT *
FROM VIEW ann_sal;

                              "Pass Any Exam. Any Time." - Guaranteed                      74
Oracle 1z0-001: Practice Exam
Answer: C



QUESTION NO: 134

The PLAYER table contains these columns:


ID NUMBER(9)
NAME VARCHAR(2)
MANAGER_ID NUMBER(9)


In this instance, managers are players and you need to display a list of players.
Evaluate these two SQL statements:


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.id = p.manager_id;


SELECT p.name, m.name
FROMplayer p, player m
WHEREm.manager_id = p.id;


How will the results differ?

A. The results will be the same, but the display will be different.
B. Statement 1 will execute; statement 2 will not.
C. Statement 1 will not execute; statement 2 will.
D. Statement 1 is self-join; statement 2 is not.

Answer: A



QUESTION NO: 135

Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.


You issue this SQL statement:


SELECT pr.name
FROMpart pt, product pr
WHEREpt.product_id(+) = pr.id;


What is the result?

                        "Pass Any Exam. Any Time." - Guaranteed                         75
Oracle 1z0-001: Practice Exam




A. A list of products is displayed for parts that have products assigned.
B. A list of all product names is displayed.
C. A list of all products is displayed for products with parts.
D. An error is generated.

Answer: B



QUESTION NO: 136

Which statement is true about nesting blocks?

A. A variable defined in the inner block is visible in the outer blocks.
B. A variable defined in the outer block is visible in the inner blocks.
C. Variable names must be unique between blocks.
D. A variable in an inner block may have the same name as a variable in an outer block only if the
data types are different.

Answer: B



QUESTION NO: 137

Which statement about multiple column subqueries is true?

A. A pairwise comparison produces a cross product.
B. In a pairwise subquery, the values returned from the subquery are compared individually to the
values in the outer query.
C. In a non-pairwise subquery, the values returned from the subquery are compared as a group to
the values in the outer query.
D. A non-pairwise comparison produces a cross product.

Answer: D



QUESTION NO: 138

Examine the code:


                       "Pass Any Exam. Any Time." - Guaranteed                                  76
Oracle 1z0-001: Practice Exam
SET SERVEROUTPUT ON
DECLARE
v_char_val VARCHAR2(100);
BEGIN
v_char_val := 'Hello World';
DBMS_OUTPUT.PUT_LINE(v_char_val);
END;
SET SERVEROUTPUT OFF


This code is stored in a script file named myproc.sql. Which statement executes the code in the
script file?

A. EXECUTE myproc.sql
B. RUN myproc.sql
C. BEGIN myproc.sql END;
D. myproc.sql
E. START myproc.sql

Answer: E



QUESTION NO: 139

You want to display the average salary for departments 20 and 50, but only if those departments
have an average salary of at least 2000. Which statement will produce the required results?

A. SELECT deptno, AVG(sal)
FROM emp
GROUP BY deptno
HAVING AVG(sal) >= 2000
AND deptno IN (20, 50);
B. SELECT deptno, AVG(sal)
FROM emp
WHERE deptno IN (20, 50)
GROUP BY deptno
HAVING AVG(sal) >= 2000;
C. SELECT deptno, AVG(sal)
FROM emp
WHERE deptno IN (20, 50)
GROUP BY AVG(sal)
HAVING AVG(sal) >= 2000;
D. SELECT deptno, AVG(sal)
FROM emp

                      "Pass Any Exam. Any Time." - Guaranteed                                     77
Oracle 1z0-001: Practice Exam
WHERE deptno IN (20, 50)
AND AVG(sal) >= 2000
GROUP BY deptno;

Answer: B



QUESTION NO: 140

Click on the EXHIBIT button and examine the employee table.


You attempt to query the database with this command:


SELECT dept_no, last_name, SUM(salary)
FROM employee
WHERE salary < 50000
GROUP BY dept_no
ORDER BY last_name;


Which clause causes an error?




A. WHERE salary < 50000
B. FROM employee
C. ORDER BY last_name
D. GROUP BY dept_no

Answer: D



QUESTION NO: 141



                     "Pass Any Exam. Any Time." - Guaranteed    78
Oracle 1z0-001: Practice Exam
Given this CURSOR statement:
DECLARE
CURSOR query_cursor (v_salary) IS
SELECT last_name, salary, dept_no
FROM employee
WHERE salary > v_salary;


Why does this statement cause an error?

A. A scalar datatype was not specified for the parameter.
B. A WHERE clause is not allowed in a CURSOR statement.
C. The INTO clause is missing from the SELECT statement.
D. The parameter mode was not defined.

Answer: A



QUESTION NO: 142

Which three SQL arithmetic expressions return a date? (Choose three.)

A. ('03-JUL-96' - '04-JUL-97') / 7
B. ('03-JUL-96' - '04-JUL-97') / 12
C. '03-JUL-96' + (12 / 24)
D. '03-JUL-96' - '04-JUL-97'
E. '03-JUL-96' + 7
F. '03-JUL-96' - 12

Answer: C,E,F



QUESTION NO: 143

When selecting data, which statement is valid about projection?

A. Projection allows you to choose columns.
B. Projection allows you to choose rows.
C. Projection allows you to join tables together.
D. Projection allows you to add columns to a table.

Answer: A




                       "Pass Any Exam. Any Time." - Guaranteed          79
Oracle 1z0-001: Practice Exam
QUESTION NO: 144

Which statement describes the use of a group function?

A. A group function produces one result from many rows per group.
B. A group function produces one result from each row of the table.
C. A group function produces a group of results from one row.
D. A group function produces many results from many rows per group.

Answer: A



QUESTION NO: 145

Which datatype should you use for interest rates with varying and unpredictable decimal places,
such as 1.234, 3.4, 5, and 1.23?

A. NUMBER(p,s)
B. LONG
C. NUMBER

Answer: C



QUESTION NO: 146

The structure of the DEPT table is as follows:


Name Null? Type
------------------------------- -------- -------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)


Examine the code:


DECLARE
TYPE dept_record_type IS RECORD
(dno NUMBER,
name VARCHAR2(20));
dept_rec dept_record_type;
BEGIN
SELECT deptno, dname
INTO dept_rec

                              "Pass Any Exam. Any Time." - Guaranteed                         80
Oracle 1z0-001: Practice Exam
FROM dept
WHERE deptno = 10;
END;


Which statement displays the name of the selected department?

A. DBMS_OUTPUT.PUT_LINE(dept_rec.name);
B. DBMS_OUTPUT.PUT_LINE(dname);
C. DBMS_OUTPUT.PUT_LINE(dept_rec.dname);
D. DBMS_OUTPUT.PUT_LINE(name);
E. DBMS_OUTPUT.PUT_LINE(dept_rec(name));

Answer: A



QUESTION NO: 147

You need to create a report to display the ship date and order totals of your ORDER table. If the
order has not been shipped, your report must display 'Not Shipped'. If the total is not available,
your report must display 'Not Available'.


In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a
datatype of NUMBER.


Which statement do you use to create this report?

A. SELECT ordid, NVL(shipdate, 'Not Shipped'),
NVL(total,'Not Available')
FROM order;
B. SELECT ordid, shipdate "Not Shipped",
total "Not Available"
FROM order;
C. SELECT ordid, NVL(TO_CHAR(shipdate), 'Not Shipped'),
NVL(TO_CHAR(total),'Not Available')
FROM order;
D. SELECT ordid,TO_CHAR(shipdate, 'Not Shipped'),
TO_CHAR(total,'Not Available')
FROM order;

Answer: C



QUESTION NO: 148


                       "Pass Any Exam. Any Time." - Guaranteed                                   81
Oracle 1z0-001: Practice Exam
Examine the code:


SELECT employee.ename
FROM emp employee
WHERE employee.empno NOT IN
(SELECT manager.mgr
FROM emp manager);


What is the NOT IN operator equivalent to, in the above query?

A. ALL
B. !=ALL
C. NOT LIKE
D. !=

Answer: B



QUESTION NO: 149

The PART table contains these columns:


ID NUMBER(7) PK
COST NUMBER(7,2)
PRODUCT_ID NUMBER(7)


Evaluate these two SQL statements:


1.SELECT ROUND(MAX(cost),2),
ROUND(MIN(cost),2),ROUND(SUM(cost),2),
ROUND(AVG(cost),2)
FROM part;


2.SELECT product_id, ROUND(MAX(cost),2),
ROUND(MIN(cost),2),ROUND(SUM(cost),2),
ROUND(AVG(cost),2)
FROM part
GROUP BY product_id;


How will the results differ?

A. Statement 1 will only display one row of results; statement 2 could display more than one.



                        "Pass Any Exam. Any Time." - Guaranteed                                 82
Oracle 1z0-001: Practice Exam
B. The results will be the same, but the display will differ.
C. Statement 1 will display a result for each part; statement 2 will display a result for each product.
D. One of the statements will generate an error.

Answer: A



QUESTION NO: 150

Which table name is valid?

A. invoices-1996
B. catch_#22
C. 1996_invoices
D. number
E. #_667

Answer: B



QUESTION NO: 151

In which section of a PL/SQL block is a user-defined exception raised?

A. heading
B. declarative
C. exception handling
D. executable

Answer: D



QUESTION NO: 152

You need to perform a major update on the EMPLOYEE table. You have decided to disable the
PRIMARY KEY constraint on the empid column and the CHECK constraint on the job column.


What happens when you try to enable the constraints after the update is completed?

A. You need to recreate the constraints once they are disabled.
B. The indexes on both the columns with the PRIMARY KEY constraint and the CHECK constraint
are automatically re-created.
C. Any existing rows that do not confirm with the constraints are automatically deleted.
D. All the existing column values are verified to confirm with the constraints and an error message
is generated if any existing values do not confirm.
                        "Pass Any Exam. Any Time." - Guaranteed                                     83
Oracle 1z0-001: Practice Exam
E. Only the future values are verified to confirm with the constraints, leaving the existing values
unchecked.

Answer: D



QUESTION NO: 153

The structure of the DEPT table is as follows:


Name Null? Type
------------------------------- ------------ --------
DEPTNO NOT NULL NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)


Examine the declaration section:


DECLARE
TYPE dept_record_type IS RECORD
(dno NUMBER,
name VARCHAR2(20));
dept_rec dept_record_type;


How do you retrieve an entire row of the DEPT table using the DEPT_REC variable?

A. SELECT *
INTO dept_rec.dno, dept_rec.name, dept_rec.loc
FROM dept
WHERE deptno = 10;
B. You can not retrieve the entire row using the DEPT_REC variable declared in the code.
C. SELECT deptno, dname, loc
INTO dept_rec
FROM dept
WHERE deptno = 10;
D. SELECT *
INTO dept_rec
FROM dept
WHERE deptno = 10;

Answer: B




                              "Pass Any Exam. Any Time." - Guaranteed                                 84
Oracle 1z0-001: Practice Exam


QUESTION NO: 154

You need to update employee salaries. If the salary of an employee is less than 1000, the salary
needs to be incremented by 10%.


Use a SQL*Plus substitution variable to accept the employee number.


Which PL/SQL block successfully updates the salaries?

A. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
WHERE empno = &&p_empno;
IF (v_sal < 1000) THEN
UPDATE emp
INTO sal := sal * 1.1
WHERE empno = &p_empno;
END IF;
END;
B. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
WHERE empno = &&p_empno;
IF (v_sal < 1000) THEN
UPDATE emp
SET sal = sal * 1.1
WHERE empno = &p_empno;
END IF;
END;
C. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
WHERE empno = &&p_empno;
                      "Pass Any Exam. Any Time." - Guaranteed                                  85
Oracle 1z0-001: Practice Exam
IF (v_sal < 1000) THEN
UPDATE emp
sal := sal * 1.1
WHERE empno = &p_empno;
END IF;
END;
D. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
WHERE empno = &&p_empno;
IF (v_sal < 1000) THEN
sal := sal * 1.1;
END IF;
END;

Answer: B



QUESTION NO: 155

Scott forgot his password while on vacation. What command must be executed to set a password
for Scott?

A. Scott must execute the command:
ALTER USER scott
IDENTIFIED BY lion;
B. The DBA must execute the command:
CHANGE PASSWORD TO lion
WHERE USER = 'SCOTT';
C. Scott must execute the command:
ALTER USER scott
PASSWORD BY lion;
D. Scott must execute the command:
CHANGE PASSWORD TO lion
WHERE USER = 'SCOTT';
E. The DBA must execute the command:
ALTER USER scott
IDENTIFIED BY lion;




                     "Pass Any Exam. Any Time." - Guaranteed                              86
Oracle 1z0-001: Practice Exam
Answer: E



QUESTION NO: 156

You issue this command:


CREATE PUBLIC SYNONYM emp
FOR ed.employee;


Which task has been accomplished?

A. All users were given object privileges to the table.
B. The need to qualify the object name with its schema has been eliminated for all users.
C. The need to qualify the object name with its schema was eliminated for only you.
D. The object can now be accessed by all users.

Answer: B



QUESTION NO: 157

In the declarative section of a PL/SQL block, you created but did not initialize a number variable.
When the block executes, what will be the initial value of the variable?

A. null
B. It depends on the scale and precision of the variable.
C. The block will not execute because the variable was not initialized.The block will not execute
because the variable was not initialized.
D. 0

Answer: A



QUESTION NO: 158

Which data dictionary view contains the definition of a view?

A. USER_VIEWS
B. SYSTEM_VIEWS
C. USER_TAB_VIEWS
D. MY_VIEWS

Answer: A


                       "Pass Any Exam. Any Time." - Guaranteed                                      87
Oracle 1z0-001: Practice Exam



QUESTION NO: 159

Which statement is true about nesting blocks?

A. Variable names must be unique between blocks.
B. A variable defined in the outer block is visible in the inner blocks.
C. A variable in an inner block may have the same name as a variable in an outer block only if the
data types are different.
D. A variable defined in the inner block is visible in the outer blocks.

Answer: B



QUESTION NO: 160

Examine the structure of the STUDENT table:


Name Null? Type
------------- ------------- ------------
STUD_ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(25)
ADDRESS VARCHAR2(50)
GRADUATION DATE


Which statement adds a new column after the NAME column to hold phone numbers?

A. ALTER TABLE student
ADD COLUMN3 (phone varchar2(9));
B. ALTER TABLE student
ADD (phone varchar2(9)) AS COLUMN3;
C. You cannot specify the position where a new column has to be added.
D. ALTER TABLE student
ADD COLUMN phone varchar2(9) POSITION 3;

Answer: C



QUESTION NO: 161

Evaluate these two SQL commands:


1.SELECT DISTINCT object_type

                         "Pass Any Exam. Any Time." - Guaranteed                                88
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001

Mais conteúdo relacionado

Mais procurados

Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaEdureka!
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorialGiuseppe Maxia
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptDrRShaliniVISTAS
 
Ecdl v5 module 5 print
Ecdl v5 module 5 printEcdl v5 module 5 print
Ecdl v5 module 5 printMichael Lew
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database FundamentalGong Haibing
 
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1SolarWinds
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?CPD INDIA
 
1. SQL Basics - Introduction
1. SQL Basics - Introduction1. SQL Basics - Introduction
1. SQL Basics - IntroductionVarun A M
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1ReKruiTIn.com
 
İleri Seviye T-SQL Programlama - Chapter 11
İleri Seviye T-SQL Programlama - Chapter 11İleri Seviye T-SQL Programlama - Chapter 11
İleri Seviye T-SQL Programlama - Chapter 11Cihan Özhan
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Khaled Anaqwa
 
Advanced PLSQL Optimizing for Better Performance
Advanced PLSQL Optimizing for Better PerformanceAdvanced PLSQL Optimizing for Better Performance
Advanced PLSQL Optimizing for Better PerformanceZohar Elkayam
 
Creating Views - oracle database
Creating Views - oracle databaseCreating Views - oracle database
Creating Views - oracle databaseSalman Memon
 
Part1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerPart1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerMaria Colgan
 

Mais procurados (20)

Plsql lab mannual
Plsql lab mannualPlsql lab mannual
Plsql lab mannual
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | Edureka
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Dbms practical list
Dbms practical listDbms practical list
Dbms practical list
 
Ecdl v5 module 5 print
Ecdl v5 module 5 printEcdl v5 module 5 print
Ecdl v5 module 5 print
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
SQL
SQLSQL
SQL
 
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 1
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
1. SQL Basics - Introduction
1. SQL Basics - Introduction1. SQL Basics - Introduction
1. SQL Basics - Introduction
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
 
İleri Seviye T-SQL Programlama - Chapter 11
İleri Seviye T-SQL Programlama - Chapter 11İleri Seviye T-SQL Programlama - Chapter 11
İleri Seviye T-SQL Programlama - Chapter 11
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
 
Advanced PLSQL Optimizing for Better Performance
Advanced PLSQL Optimizing for Better PerformanceAdvanced PLSQL Optimizing for Better Performance
Advanced PLSQL Optimizing for Better Performance
 
Sql wksht-1
Sql wksht-1Sql wksht-1
Sql wksht-1
 
Creating Views - oracle database
Creating Views - oracle databaseCreating Views - oracle database
Creating Views - oracle database
 
Sql oracle
Sql oracleSql oracle
Sql oracle
 
Part1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the OptimizerPart1 of SQL Tuning Workshop - Understanding the Optimizer
Part1 of SQL Tuning Workshop - Understanding the Optimizer
 
Sql Tutorials
Sql TutorialsSql Tutorials
Sql Tutorials
 

Destaque

Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库renguzi
 
15 questions sql advance
15 questions sql   advance15 questions sql   advance
15 questions sql advanceNaviSoft
 
Oracle 10g sql fundamentals i
Oracle 10g sql fundamentals iOracle 10g sql fundamentals i
Oracle 10g sql fundamentals iManaswi Sharma
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answersvijaybusu
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Destaque (8)

Pl lab solution
Pl lab solutionPl lab solution
Pl lab solution
 
Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库
 
15 questions sql advance
15 questions sql   advance15 questions sql   advance
15 questions sql advance
 
Oracle 10g sql fundamentals i
Oracle 10g sql fundamentals iOracle 10g sql fundamentals i
Oracle 10g sql fundamentals i
 
1 z0 047
1 z0 0471 z0 047
1 z0 047
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Semelhante a 1 z0 001

1z0 061 exam-oracle database 12c sql fundamentals
1z0 061 exam-oracle database 12c sql fundamentals1z0 061 exam-oracle database 12c sql fundamentals
1z0 061 exam-oracle database 12c sql fundamentalsIsabella789
 
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdf
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdfgratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdf
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdfNarReg
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessmentSaurabh K. Gupta
 
1Z0-061 Oracle Database 12c: SQL Fundamentals
1Z0-061 Oracle Database 12c: SQL Fundamentals1Z0-061 Oracle Database 12c: SQL Fundamentals
1Z0-061 Oracle Database 12c: SQL FundamentalsLydi00147
 
Oracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersOracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersDTecH It Education
 
284566820 1 z0-061(1)
284566820 1 z0-061(1)284566820 1 z0-061(1)
284566820 1 z0-061(1)panagara
 
Dbms question
Dbms questionDbms question
Dbms questionRicky Dky
 
A New View of Database Views
A New View of Database ViewsA New View of Database Views
A New View of Database ViewsMichael Rosenblum
 
Subqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactionsSubqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactionsmaxpane
 
Database solution by m.moses wills
Database solution by m.moses willsDatabase solution by m.moses wills
Database solution by m.moses willsMoses Mwebaze
 
Database solution by m.moses wills
Database solution by m.moses willsDatabase solution by m.moses wills
Database solution by m.moses willsMoses Mwebaze
 
Programming in Oracle with PL/SQL
Programming in Oracle with PL/SQLProgramming in Oracle with PL/SQL
Programming in Oracle with PL/SQLlubna19
 
Performance tuning
Performance tuningPerformance tuning
Performance tuningami111
 

Semelhante a 1 z0 001 (20)

1z0 061 exam-oracle database 12c sql fundamentals
1z0 061 exam-oracle database 12c sql fundamentals1z0 061 exam-oracle database 12c sql fundamentals
1z0 061 exam-oracle database 12c sql fundamentals
 
Plsql pdf
Plsql pdfPlsql pdf
Plsql pdf
 
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdf
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdfgratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdf
gratisexam.com-Oracle.BrainDumps.1z0-061.v2016-10-10.by.Laura.75q.pdf
 
PLSQL (1).ppt
PLSQL (1).pptPLSQL (1).ppt
PLSQL (1).ppt
 
Advanced plsql mock_assessment
Advanced plsql mock_assessmentAdvanced plsql mock_assessment
Advanced plsql mock_assessment
 
1Z0-061 Oracle Database 12c: SQL Fundamentals
1Z0-061 Oracle Database 12c: SQL Fundamentals1Z0-061 Oracle Database 12c: SQL Fundamentals
1Z0-061 Oracle Database 12c: SQL Fundamentals
 
Oracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for FreshersOracle SQL Interview Questions for Freshers
Oracle SQL Interview Questions for Freshers
 
Plsql
PlsqlPlsql
Plsql
 
284566820 1 z0-061(1)
284566820 1 z0-061(1)284566820 1 z0-061(1)
284566820 1 z0-061(1)
 
Plsql
PlsqlPlsql
Plsql
 
Dbms question
Dbms questionDbms question
Dbms question
 
SQL MCQ
SQL MCQSQL MCQ
SQL MCQ
 
Les09
Les09Les09
Les09
 
A New View of Database Views
A New View of Database ViewsA New View of Database Views
A New View of Database Views
 
Subqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactionsSubqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactions
 
Database solution by m.moses wills
Database solution by m.moses willsDatabase solution by m.moses wills
Database solution by m.moses wills
 
Database solution by m.moses wills
Database solution by m.moses willsDatabase solution by m.moses wills
Database solution by m.moses wills
 
Programming in Oracle with PL/SQL
Programming in Oracle with PL/SQLProgramming in Oracle with PL/SQL
Programming in Oracle with PL/SQL
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
PL-SQL.pdf
PL-SQL.pdfPL-SQL.pdf
PL-SQL.pdf
 

Último

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Último (20)

Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

1 z0 001

  • 1. Oracle 1z0-001: Practice Exam QUESTION NO: 1 The PLAYER table contains these columns: ID NUMBER(9) NAME VARCHAR(2) MANAGER_ID NUMBER(9) In this instance, managers are players and you need to display a list of players. Evaluate these two SQL statements: SELECT p.name, m.name FROMplayer p, player m WHEREm.id = p.manager_id; SELECT p.name, m.name FROMplayer p, player m WHEREm.manager_id = p.id; How will the results differ? A. Statement 1 will not execute; statement 2 will. B. The results will be the same, but the display will be different. C. Statement 1 will execute; statement 2 will not. D. Statement 1 is self-join; statement 2 is not. Answer: B QUESTION NO: 2 Under which situation is it necessary to use an explicit cursor? A. when a SELECT statement in a PL/SQL block retrieves more than one row B. when an UPDATE statement in a PL/SQL block has to modify more than one row C. when a DELETE statement in a PL/SQL block deletes more than one row D. when any DML or SELECT statement is used in a PL/SQL block Answer: A QUESTION NO: 3 "Pass Any Exam. Any Time." - Guaranteed 2
  • 2. Oracle 1z0-001: Practice Exam Which statement is true when a DROP TABLE command is executed on a table? A. Any pending transactions on the table are rolled back. B. The table structure and its deleted data cannot be rolled back and restored once the DROP TABLE command is executed. C. The DROP TABLE command can be executed on a table on which there are pending transactions. D. The structure of the table remains in the database, and the data and indexes are deleted. E. Only a DBA can execute the DROP TABLE command. Answer: B QUESTION NO: 4 Which statement about implicit cursors is true? A. Programmers need to close all the implicit cursors before the end of the PL/SQL program. B. Programmers can declare implicit cursors by using the CURSOR type in the declaration section. C. Implicit cursors are declared implicitly only for DML statements. D. Implicit cursors are declared implicitly for all the DML and SELECT statements. Answer: D QUESTION NO: 5 How would you add a foreign key constraint on the dept_no column in the EMP table, referring to the id column in the DEPT table? A. Use the ALTER TABLE command with the ADD clause on the EMP table. B. Use the ALTER TABLE command with the MODIFY clause on the EMP table. C. Use the ALTER TABLE command with the ADD clause on the DEPT table. D. This task cannot be accomplished. E. Use the ALTER TABLE command with the MODIFY clause on the DEPT table. Answer: A QUESTION NO: 6 Evaluate this SQL script: CREATE ROLE manager; "Pass Any Exam. Any Time." - Guaranteed 3
  • 3. Oracle 1z0-001: Practice Exam CREATE ROLE clerk; CREATE ROLE inventory; CREATE USER scott IDENTIFIED BY tiger; GRANT inventory TO clerk; GRANT clerk TO manager; GRANT inventory TO scott / How many roles will user SCOTT have access to? A. 1 B. 2 C. 0 D. 3 Answer: A QUESTION NO: 7 You want to display the details of all employees whose last name is Smith, but you are not sure in which case the last names are stored. Which statement will list all the employees whose last name is Smith? A. SELECT lastname, firstname FROM emp WHERE LOWER(lastname) = 'smith'; B. SELECT lastname, firstname FROM emp WHERE UPPER(lastname) = 'smith'; C. SELECT lastname, firstname FROM emp WHERE lastname = 'smith'; D. SELECT lastname, firstname FROM emp WHERE lastname = UPPER('smith'); Answer: A QUESTION NO: 8 You are updating the employee table. Jane has been granted the same privileges as you on the employee table. You ask Jane to log on to the database to check your work before you issue a "Pass Any Exam. Any Time." - Guaranteed 4
  • 4. Oracle 1z0-001: Practice Exam COMMIT command. What can Jane do to the employee table? A. Jane can access the table, but she cannot see your changes and cannot make the same changes. B. Jane can access the table and verify your changes. C. Jane cannot access the table. D. Jane can access the table, but she cannot see your changes. She can make the changes for you. Answer: A QUESTION NO: 9 Click on the EXHIBIT button and examine the table instance chart for the sales table. You attempt to change the database with this command: INSERT INTO sales (purchase_no, customer_id, car_id) VALUES (1234, 345, 6); If this statement fails, which condition would explain the failure? A. The sales table has too many foreign keys. B. The statement has invalid datatypes. C. A mandatory column value is missing. D. This statement does not fail at all. Answer: C QUESTION NO: 10 Which statement about SQL is true? A. Date values are displayed in descending order by default. "Pass Any Exam. Any Time." - Guaranteed 5
  • 5. Oracle 1z0-001: Practice Exam B. Null values are displayed last in ascending sequences. C. The results are sorted by the first column in the SELECT list if the ORDER BY clause is not provided. D. You cannot specify a column alias in an ORDER BY clause. E. You cannot sort query results by a column that is not included the SELECT list. Answer: B QUESTION NO: 11 Evaluate this SQL statement: SELECTe.id, (.15 * e.salary) + (.25 * e.bonus) + (s.sale_amount * (.15 * e.commission_pct)) FROMemployee e, sale s WHEREe.id = s.emp_id; What would happen if you removed all the parentheses from the calculation? A. The results will be lower. B. The statement will achieve the same results. C. The statement will not execute. D. The results will be higher. Answer: B QUESTION NO: 12 Within a PL/SQL loop, you need to test if the current fetch was successful. Which SQL cursor attribute would you use to accomplish this task? A. A SQL cursor attribute cannot be used within a PL/SQL loop. B. This task cannot be accomplished with a SQL cursor attribute. C. SQL%ROWCOUNT D. SQL%ISOPEN E. SQL%FOUND Answer: E QUESTION NO: 13 In the declarative section of a PL/SQL block, you created but did not initialize a number variable. When the block executes, what will be the initial value of the variable? "Pass Any Exam. Any Time." - Guaranteed 6
  • 6. Oracle 1z0-001: Practice Exam A. The block will not execute because the variable was not initialized.The block will not execute because the variable was not initialized. B. 0 C. null D. It depends on the scale and precision of the variable. Answer: C QUESTION NO: 14 Examine the code: DECLARE CURSOR emp_cursor IS SELECT ename, deptno FROM emp; emp_rec emp_cursor%ROWTYPE; BEGIN OPEN emp_cursor; LOOP FETCH emp_cursor INTO emp_rec; EXIT WHEN emp_cursor%NOTFOUND; INSERT INTO temp_emp(name, dno) VALUES (emp_rec.ename, emp_rec.deptno); END LOOP; CLOSE emp_cursor; END; Using a cursor FOR loop, which PL/SQL block is equivalent to the above code? A. DECLARE CURSOR emp_cursor IS SELECT ename, deptno FROM emp; BEGIN FOR emp_rec IN emp_cursor LOOP INSERT INTO temp_emp(name, dno) VALUES (emp_rec.ename, emp_rec.deptno); END LOOP; CLOSE emp_cursor; END; "Pass Any Exam. Any Time." - Guaranteed 7
  • 7. Oracle 1z0-001: Practice Exam B. DECLARE CURSOR emp_cursor IS SELECT ename, deptno FROM emp; BEGIN FOR emp_rec IN emp_cursor LOOP INSERT INTO temp_emp(name, dno) VALUES (emp_rec.ename, emp_rec.deptno); END LOOP; END; C. DECLARE CURSOR emp_cursor IS SELECT ename, deptno FROM emp; emp_rec emp_cursor%ROWTYPE; BEGIN FETCH emp_cursor INTO emp_rec; FOR emp_rec IN emp_cursor LOOP INSERT INTO temp_emp(name, dno) VALUES (emp_rec.ename, emp_rec.deptno); END LOOP; END; D. DECLARE CURSOR emp_cursor IS SELECT ename, deptno FROM emp; BEGIN FOR emp_rec IN emp_cursor LOOP OPEN emp_cursor; INSERT INTO temp_emp(name, dno) VALUES (emp_rec.ename, emp_rec.deptno); END LOOP; END; Answer: B QUESTION NO: 15 You want to retrieve the employee details from the EMP table and process them in PL/SQL block. Which type of variable do you create in the PL/SQL block to retrieve all the rows and columns using a single SELECT statement from the EMP table? "Pass Any Exam. Any Time." - Guaranteed 8
  • 8. Oracle 1z0-001: Practice Exam A. PL/SQL table of scalars B. PL/SQL table of records C. %ROWTYPE variable D. PL/SQL record Answer: B QUESTION NO: 16 Given this executable section of a PL/SQL block: BEGIN FOR employee_record IN salary_cursor LOOP employee_id_table(employee_id) := employee_record.last_name; END LOOP; CLOSE salary_cursor; END; Why does this section cause an error? A. The cursor does not need to be closed. B. No FETCH statements were issued. C. Terminating conditions are missing. D. The cursor needs to be opened. Answer: A QUESTION NO: 17 Evaluate this PL/SQL block: DECLARE v_result NUMBER(2); BEGIN DELETE FROM employee WHERE dept_id IN (10, 20, 30); v_result := SQL%ROWCOUNT; COMMIT; END; "Pass Any Exam. Any Time." - Guaranteed 9
  • 9. Oracle 1z0-001: Practice Exam What will be the value of V_RESULT if no rows are deleted? A. 1 B. NULL C. 0 D. FALSE E. TRUE Answer: C QUESTION NO: 18 Which SELECT statement displays all the employees who do not have any subordinates? A. SELECT e.ename FROM emp e WHERE e.empno NOT IN (SELECT m.mgr FROM emp m WHERE m.mgr IS NOT NULL); B. SELECT e.ename FROM emp e WHERE e.empno IN (SELECT m.mgr FROM emp m); C. SELECT e.ename FROM emp e WHERE e.mgr IS NOT NULL; D. SELECT e.ename FROM emp e WHERE e.empno NOT IN (SELECT m.mgr FROM emp m); Answer: A QUESTION NO: 19 As a DBA, you have just created a user account for employee Smith by using the CREATE USER command. Smith should be able to create tables and packages in his schema. Which command will the DBA need to execute next so that Smith can perform his tasks successfully? A. GRANT CREATE CONNECT, CREATE TABLE, CREATE PROCEDURE TO smith; "Pass Any Exam. Any Time." - Guaranteed 10
  • 10. Oracle 1z0-001: Practice Exam B. GRANT CREATE TABLE, CREATE PACKAGE TO smith; C. GRANT CREATE TABLE, CREATE PROCEDURE TO smith; D. GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE TO smith; Answer: D QUESTION NO: 20 Evaluate this IF statement: IF v_value > 100 THEN v_new_value := 2 * v_value; ELSIF v_value > 200 THEN v_new_value := 3 * v_value; ELSIF v_value < 300 THEN v_new_value := 4 * v_value; ELSE v_new_value := 5 * v_value; END IF; What would be assigned to V_NEW_VALUE if V_VALUE is 250? A. 250 B. 1250 C. 750 D. 500 E. 1000 Answer: D QUESTION NO: 21 Click on the EXHIBIT button and examine the table instance chart for the patient table. You created the patient_vu view based on id_number and last_name from the patient table. What is the best way to modify the view to contain only those patients born in 1997? "Pass Any Exam. Any Time." - Guaranteed 11
  • 11. Oracle 1z0-001: Practice Exam A. Drop the patient_vu, then create a new view with a WHERE clause. B. Replace the view adding a WHERE clause. C. Drop the patient_vu, then create a new view with a HAVING clause. D. Use the ALTER command to add a WHERE clause to verify the time. Answer: B QUESTION NO: 22 Mr. King is the president of a company. Five managers report to him. All other employees report to these managers. Examine the code: SELECT employee.ename FROM emp employee WHERE employee.empno NOT IN (SELECT manager.mgr FROM emp manager); The above statement returns no rows selected. as the result. Why? A. None of the employees has a manager. B. A NULL value is returned from the subquery. C. All employees have a manager. D. NOT IN operator is not allowed in subqueries. Answer: B QUESTION NO: 23 Examine the structure of the STUDENT table: "Pass Any Exam. Any Time." - Guaranteed 12
  • 12. Oracle 1z0-001: Practice Exam Name Null? Type ----------------- ----------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Which statement inserts a new row into the STUDENT table? A. INSERT INTO student (stud_id, address, graduation) VALUES (101,'100 Main Street','17-JUN-99'); B. INSERT INTO student (stud_id, address, name, graduation) VALUES (101,'100 Main Street','Smith','17-JUN-99'); C. INSERT INTO student VALUES (101,'100 Main Street','17-JUN-99','Smith'); D. INSERT INTO student VALUES (101,'Smith'); E. INSERT INTO student table VALUES (101,'Smith','100 Main Street','17-JUN-99'); Answer: B QUESTION NO: 24 Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement? A. LIKE operator B. IN operator C. equal operator D. greater than or equal to operator E. BETWEEN x AND y operator Answer: C QUESTION NO: 25 You have been granted UPDATE privileges on the last_name column of the employee table. Which data dictionary view would you query to display the column the privilege was granted on and the schema that owns the employee table? A. ALL_TABLES "Pass Any Exam. Any Time." - Guaranteed 13
  • 13. Oracle 1z0-001: Practice Exam B. This information cannot be retrieved from a single data dictionary view. C. ALL_SOURCE D. TABLE_PRIVILEGES E. ALL_COL_PRIVS_RECD F. ALL_OBJECTS Answer: E QUESTION NO: 26 Examine the table structures: EMP Table Name Null? Type ------------------------------- ------------- ----------- EMPNO NOT NULL NUMBER(4) NAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SALARY NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NOT NULL NUMBER(2) TAX Table Name Null? Type ------------------------------- -------- ----------- TAXGRADE NUMBER LOWSAL NUMBER HIGHSAL NUMBER You want to create a report that displays the employee details along with the tax category of each employee. The tax category is determined by comparing the salary of the employee from the EMP table to the lower and upper salary values in the TAX table. Which SELECT statement produces the required results? A. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary IN t.lowsal AND t.highsal; B. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t "Pass Any Exam. Any Time." - Guaranteed 14
  • 14. Oracle 1z0-001: Practice Exam WHERE e.salary BETWEEN t.lowsal AND t.highsal; C. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary >= t.lowsal AND <= t.highsal; D. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary <= t.lowsal AND e.salary >= t.highsal; Answer: B QUESTION NO: 27 How do you declare a PL/SQL table of records to hold the rows selected from the EMP table? A. DECLARE emp_table IS TABLE OF emp%ROWTYPE; B. DECLARE TYPE emp_table_type IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER; emp_table emp_table_type; C. BEGIN TYPE emp_table_type IS TABLE OF emp%ROWTYPE; emp_table emp_table_type; D. DECLARE TYPE emp_table_type IS TABLE OF emp%ROWTYPE INDEX BY WHOLE_NUMBER; emp_table emp_table_type; Answer: B QUESTION NO: 28 Examine the structure of the STUDENT table: Name Null? Type ------------------ -------------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Graduation column is a foreign key column to the GRADDATE table. "Pass Any Exam. Any Time." - Guaranteed 15
  • 15. Oracle 1z0-001: Practice Exam Examine the data in the GRADDATE table: GRADUATION -------------- 20-JAN-1999 12-MAY-1999 19-JAN-2000 25-MAY-2000 13-JAN-2001 29-MAY-2001 Which update statement produces the following error? ORA-02291: integrity constraint (SYS_C23) violated - parent key not found A. UPDATE student SET name = 'Smith', graduation = '15-AUG-2000' WHERE stud_id = 101; B. UPDATE studentD.UPDATE student SET stud_id = NULL, address = '100 Main Street' WHERE graduation = '20-JAN-1999'; C. UPDATE student SET name = 'Smith', graduation = '29-MAY-2001' WHERE stud_id = 101; D. UPDATE student SET stud_id = 999, graduation = '29-MAY-2001' WHERE stud_id = 101; Answer: A QUESTION NO: 29 The EMPLOYEE table contains these columns: FIRST_NAMEVARCHAR2(25) COMMISSION NUMBER(3,2) Evaluate this SQL statement: SELECT first_name, commission "Pass Any Exam. Any Time." - Guaranteed 16
  • 16. Oracle 1z0-001: Practice Exam FROM employee WHERE commission = (SELECTcommission FROMemployee WHEREUPPER(first_name) = 'SCOTT') What would cause this statement to fail? A. Scott has a NULL commission value. B. There is no employee with the first name Scott. C. The FIRST_NAME values in the database are in lowercase. D. Scott has a zero commission value. E. There is more than one employee with the first name Scott. Answer: E QUESTION NO: 30 The EMPLOYEE table contains these columns: LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) SALARY NUMBER(7,2) You need to display the names of employees that earn more than the average salary of all employees. Evaluate this SQL statement: SELECT last_name, first_name FROMemployee WHEREsalary > AVG(salary); Which change should you make to achieve the desired results? A. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause. B. Change the function in the WHERE clause. C. Move the function to the SELECT clause and add a GROUP BY clause. D. Use a subquery in the WHERE clause to compare the average salary value. Answer: D QUESTION NO: 31 "Pass Any Exam. Any Time." - Guaranteed 17
  • 17. Oracle 1z0-001: Practice Exam In which section of a PL/SQL block is a user-defined exception raised? A. exception handling B. executable C. heading D. declarative Answer: B QUESTION NO: 32 You are a user of the PROD database which contains over 1000 tables, and you need to determine the number of tables you can access. Which data dictionary view could you query to display this information? A. DBA_TABLES B. ALL_OBJECTS C. USER_OBJECTS D. DBA_SEGMENTS Answer: B QUESTION NO: 33 Using SQL*Plus, you created a user with this command: CREATE USER jennifer IDENTIFIED BY jbw122; What should you do to allow the user database access? A. Grant the user the CREATE SESSION privilege. B. Use the ALTER USER to assign the user a default profile. C. Use the ALTER USER command to assign the user a default tablespace. D. No action is required to give the user database access. Answer: A QUESTION NO: 34 The EMPLOYEE table contains these columns: FIRST_NAME VARCHAR2(25) "Pass Any Exam. Any Time." - Guaranteed 18
  • 18. Oracle 1z0-001: Practice Exam LAST_NAME VARCHAR2(25) Evaluate these two SQL statements: 1. SELECT CONCAT(first_name, last_name), LENGTH(CONCAT(first_name, last_name)) FROM employee WHERE UPPER(last_name) LIKE '%J' ORUPPER(last_name) LIKE '%K' ORUPPER(last_name) LIKE '%L'; 2. SELECT INITCAP(first_name) || INITCAP(last_name), LENGTH(last_name) + LENGTH(first_name) FROM employee WHERE INITCAP(SUBSTR(last_name, 1, 1)) IN ('J', 'K', 'L'); How will the results differ? A. The statements will retrieve different data from the database. B. Statement 1 will execute, but statement 2 will not. C. Statement 2 will execute, but statement 1 will not. D. The statements will retrieve the same data from the database, but will display it differently. Answer: A QUESTION NO: 35 Which statement is true when writing a cursor FOR loop? A. You do not explicitly open, fetch or close the cursor within a cursor FOR loop . B. You must explicitly close the cursor prior to the end of the program. C. You must explicitly fetch the rows within a cursor FOR loop. D. You must explicitly declare the record variable that holds the row returned from the cursor. E. You must explicitly open the cursor prior to the cursor FOR loop. Answer: A QUESTION NO: 36 You query the database with this command: SELECT last_name, first_name "Pass Any Exam. Any Time." - Guaranteed 19
  • 19. Oracle 1z0-001: Practice Exam FROM employee WHERE salary IN (SELECT salary FROM employee WHERE dept_no = 3 OR dept_no = 5); Which values are displayed? A. last name and first name of only the employees in department number 3 or 5 B. last name and first name of only the employees whose salary falls in the range of salaries from department 3 or 5 C. last name and first name of all employees except those working in department 3 or 5 D. last name and first name of all employees with the same salary as employees in department 3 or 5 Answer: D QUESTION NO: 37 You issue this command: CREATE PUBLIC SYNONYM emp FOR ed.employee; Which task has been accomplished? A. The need to qualify the object name with its schema was eliminated for only you. B. The need to qualify the object name with its schema has been eliminated for all users. C. The object can now be accessed by all users. D. All users were given object privileges to the table. Answer: B QUESTION NO: 38 The PRODUCT table contains these columns: ID NUMBER(9) PK COST NUMBER(7,2) SALE_PRICE NUMBER(7,2) Management has asked you to calculate the net revenue per unit for each product if the cost of each product is increased by 10% and the sale price of each product is increased by 25%. "Pass Any Exam. Any Time." - Guaranteed 20
  • 20. Oracle 1z0-001: Practice Exam You issue this SQL statement: SELECT id, sale_price * 1.25 - cost * 1.10 FROMproduct; Which conclusion can you draw from the results? A. The order of the operations in the calculation needs to be changed to achieve the required results. B. Only the required results are displayed. C. The results provide more information than management requested. D. A function needs to be included in the SELECT statement to achieve the desired results. Answer: B QUESTION NO: 39 Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement? A. equal operator B. LIKE operator C. IN operator D. greater than or equal to operator E. BETWEEN x AND y operator Answer: A QUESTION NO: 40 Which statement about multiple column subqueries is true? A. In a pairwise subquery, the values returned from the subquery are compared individually to the values in the outer query. B. A non-pairwise comparison produces a cross product. C. In a non-pairwise subquery, the values returned from the subquery are compared as a group to the values in the outer query. D. A pairwise comparison produces a cross product. Answer: B "Pass Any Exam. Any Time." - Guaranteed 21
  • 21. Oracle 1z0-001: Practice Exam QUESTION NO: 41 Examine the structure of the STUDENT table: Name Null? Type ---------------- ----------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) PHONE NOT NULL VARCHAR2(9) ADDRESS VARCHAR2(50) GRADUATION DATE There are 100 records in the STUDENT table. You need to modify the PHONE column to hold only numeric values. Which statement will modify the datatype of the PHONE column? A. ALTER TABLE student MODIFY COLUMN phone NUMBER(9); B. ALTER TABLE student MODIFY phone NUMBER(9); C. You cannot modify the datatype of a column if there is data in the column. D. You cannot modify a VARCHAR2 datatype to a NUMBER datatype for a column. Answer: C QUESTION NO: 42 You want to create a cursor that can be used several times in a block, selecting a different active set each time when it is opened. Which type of cursor do you create? A. a cursor for each active set B. a cursor FOR loop C. a cursor that uses parameters D. a multiple selection cursor Answer: C QUESTION NO: 43 The EMP table contains columns to hold the birth date and hire date of employees. Both of these columns are defined with DATE as their datatype. You want to insert a row with the details of "Pass Any Exam. Any Time." - Guaranteed 22
  • 22. Oracle 1z0-001: Practice Exam employee Smith who was born in 1944 and hired in 2004. Which statement will ensure that values are inserted into the table in the correct century? A. INSERT INTO EMP(empno, ename, birthdate, hiredate) VALUES (EMPNO_SEQ.NEXTVAL,'SMITH', TO_DATE('12-DEC-44','DD-MON-YY'), TO_DATE('10-JUN-04','DD-MON-YY')); B. INSERT INTO EMP(empno, ename, birthdate, hiredate) VALUES (EMPNO_SEQ.NEXTVAL,'SMITH', TO_DATE('12-DEC-1944','DD-MON-YYYY'), TO_DATE('10-JUN-04','DD-MON-RR')); C. INSERT INTO EMP(empno, ename, birthdate, hiredate) VALUES (EMPNO_SEQ.NEXTVAL,'SMITH', TO_DATE('12-DEC-44','DD-MON-RR'), TO_DATE('10-JUN-04','DD-MON-RR')); D. INSERT INTO EMP(empno, ename, birthdate, hiredate) VALUES (EMPNO_SEQ.NEXTVAL,'SMITH', '12-DEC-44', '10-JUN-04'); Answer: B QUESTION NO: 44 Click on the EXHIBIT button and examine the table instance chart for the employee table. You need to display the hire_date values in this format: 10 of October 1999. Which SELECT statement can you use? A. SELECT hire_date ('fmDD "of" MONTH YYYY') "Date Hired" FROM employee; B. SELECT TO_CHAR(hire_date, 'DDspth of MONTH YYYY') "DATE HIRED" FROM employee; "Pass Any Exam. Any Time." - Guaranteed 23
  • 23. Oracle 1z0-001: Practice Exam C. SELECT hire_date ('DD "of" MONTH YYYY') "Date Hired" FROM employee; D. SELECT TO_CHAR(hire_date, 'fmDD "of" Month YYYY') DATEHIRED FROM employee; Answer: D QUESTION NO: 45 You have decided to permanently remove all the data from the STUDENT table, and you need the table structure in the future. Which single command performs this? A. DELETE * FROM student KEEP STRUCTURE; B. TRUNCATE TABLE student KEEP STRUCTURE; C. DROP TABLE student; D. DELETE * FROM student; E. TRUNCATE TABLE student; Answer: E QUESTION NO: 46 Examine the structure of the STUDENT table: Name Null? Type ------------------ ---------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) PHONE NOT NULL VARCHAR2(9) ADDRESS VARCHAR2(50) GRADUATION DATE There are 100 records in the STUDENT table. You want to change the name of the GRADUATION column to GRAD_DATE. Which statement is true? "Pass Any Exam. Any Time." - Guaranteed 24
  • 24. Oracle 1z0-001: Practice Exam A. You cannot rename a column. B. You use the ALTER TABLE command with the RENAME COLUMN clause to rename the column. C. You use the ALTER TABLE command with the MODIFY COLUMN clause to rename the column. D. You use the ALTER TABLE command with the MODIFY clause to rename the column. Answer: A QUESTION NO: 47 The EMPLOYEE table contains these columns: LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPT_ID NUMBER(9) You need to display the names of employees that are not assigned to a department. Evaluate this SQL statement: SELECT last_name, first_name FROM employee WHEREdept_id = NULL; Which change should you make to achieve the desired result? A. Change the operator in the WHERE condition. B. Create an outer join. C. Add a second condition to the WHERE condition. D. Change the column in the WHERE condition. Answer: A QUESTION NO: 48 Click on the EXHIBIT button and examine the structure of the BOOK_TITLE, COPY, and CHECK_OUT tables. You need to create the BOOKS_AVAILABLE view. These are the desired results: 1.Include the title of each book. "Pass Any Exam. Any Time." - Guaranteed 25
  • 25. Oracle 1z0-001: Practice Exam 2.Include the availability of each book. 3.Order the results by the author. Evaluate this SQL statement: CREATE VIEW books_available AS SELECT b.title, c.availability FROMbook_title b, copy c WHEREb.id = c.title_id ORDER BY b.author; What does the statement provide? A. a syntax error B. one of the desired results C. all of the desired results D. two of the desired results Answer: A QUESTION NO: 49 Examine this block of code: SET SERVEROUTPUT ON DECLARE x NUMBER; v_sal NUMBER; v_found VARCHAR2(10) := 'TRUE'; BEGIN x := 1; v_sal := 1000; DECLARE v_found VARCHAR2(10); y NUMBER; BEGIN "Pass Any Exam. Any Time." - Guaranteed 26
  • 26. Oracle 1z0-001: Practice Exam IF (v_sal > 500) THEN v_found := 'YES'; END IF; DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found); DBMS_OUTPUT.PUT_LINE ('Value of v_sal is '|| v_sal); y := 20; END; DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found); DBMS_OUTPUT.PUT_LINE ('Value of Y is '|| TO_CHAR(y)); END; SET SERVEROUTPUT OFF What is the result of executing this block of code? A. Value of v_found is YES Value of v_sal is 1000 Value of v_found is YES Value of Y is 20 B. Value of v_found is YES Value of v_sal is 1000 Value of v_found is TRUE Value of Y is 20 C. PLS-00201: identifier 'Y' must be declared D. Value of v_found is YES Value of v_sal is 1000 Value of v_found is TRUE E. PLS-00201: identifier 'v_sal' must be declared PLS-00201: identifier 'Y' must be declared Answer: C QUESTION NO: 50 Examine the table structures: EMP Table Name Null? Type ------------------------------- -------- -------- EMPNO NOT NULL NUMBER(4) NAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE "Pass Any Exam. Any Time." - Guaranteed 27
  • 27. Oracle 1z0-001: Practice Exam SALARY NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NOT NULL NUMBER(2) TAX Table Name Null? Type ------------------------------- -------- --------- TAXGRADE NUMBER LOWSAL NUMBER HIGHSAL NUMBER You want to create a report that displays the employee details along with the tax category of each employee. The tax category is determined by comparing the salary of the employee from the EMP table to the lower and upper salary values in the TAX table. Which SELECT statement produces the required results? A. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary IN t.lowsal AND t.highsal; B. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary BETWEEN t.lowsal AND t.highsal; C. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary >= t.lowsal AND <= t.highsal; D. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary <= t.lowsal AND e.salary >= t.highsal; Answer: B QUESTION NO: 51 Click on the EXHIBIT button and examine the table instance chart for the patient table. You need to create the patient_id_seq sequence to be used with the patient table's primary key column. The sequence should begin at 1000, have a maximum value of 999999999, never reuse any numbers, and increment by 1. Which statement would you use to complete this task? "Pass Any Exam. Any Time." - Guaranteed 28
  • 28. Oracle 1z0-001: Practice Exam A. CREATE SEQUENCE patient_id_seq START WITH 1000 MAXVALUE 999999999 STEP BY 1; B. This task cannot be accomplished. C. CREATE SEQUENCE patient_id_seq ON patient (patient_id) MINVALUE 1000 MAXVALUE 999999999 INCREMENT BY 1 NOCYCLE; D. CREATE SEQUENCE patient_id_seq START WITH 1000 MAXVALUE 999999999 NOCYCLE; Answer: D QUESTION NO: 52 You attempt to query the database with this command: SELECT name, salary FROM employee WHERE salary = (SELECT salary FROM employee WHERE last_name = 'Wagner' OR dept_no = 233); Why could this statement cause an error? "Pass Any Exam. Any Time." - Guaranteed 29
  • 29. Oracle 1z0-001: Practice Exam A. A single row subquery is used with a multiple row comparison operator. B. A multiple row subquery is used with a single row comparison operator. C. Logical operators are not allowed in the WHERE clause. D. Subqueries are not allowed in the WHERE clause. Answer: B QUESTION NO: 53 Which statement shows the view definition of the view EMP_VIEW that is created based on the table EMP? A. SELECT text FROM user_views WHERE view_name = 'EMP_VIEW'; B. DESCRIBE VIEW emp_view C. SELECT view_text FROM my_views WHERE view_name = 'EMP_VIEW'; D. DESCRIBE emp E. SELECT view_text FROM TABLE emp WHERE view_name = 'EMP_VIEW'; Answer: A QUESTION NO: 54 Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.) A. The SELECT statement contains a GROUP BY clause. B. The SELECT statement returns more than one row. C. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause. D. The SELECT statement does not return a row. E. The SELECT statement does not have a WHERE clause. Answer: B,D QUESTION NO: 55 Examine the code: "Pass Any Exam. Any Time." - Guaranteed 30
  • 30. Oracle 1z0-001: Practice Exam 1 DECLARE 2 i NUMBER := 0; 3 v_date DATE; 4 BEGIN 5 i := i+1; 6 LOOP 7 v_date := v_date + 5; 8 i := i+1; 9 EXIT WHEN i = 5; 10 END LOOP; 11 END; You have encountered unexpected results when the above block of code is executed. How can you trace the values of the counter variable I and date variable V_DATE in the SQL*Plus environment? A. by inserting the statement DBMS_OUTPUT.PUT_LINE (i ||' '|| TO_CHAR(v_date)); between lines 8 and 9 B. by setting the SQL*Plus session variable DEBUGGER = TRUE C. by inserting the statement DBMS_OUTPUT.PUT_LINE (i, v_date); between lines 8 and 9 D. by inserting the statement DBMS_OUTPUT.DEBUG_VAR (i, v_date); between lines 8 and 9 Answer: A QUESTION NO: 56 The PRODUCT table contains these columns: ID NUMBER(9) PK COST NUMBER(7,2) SALE_PRICE NUMBER(7,2) Management has asked you to calculate the net revenue per unit for each product if the cost of each product is increased by 10% and the sale price of each product is increased by 25%. You issue this SQL statement: SELECT id, sale_price * 1.25 - cost * 1.10 "Pass Any Exam. Any Time." - Guaranteed 31
  • 31. Oracle 1z0-001: Practice Exam FROM product; Which conclusion can you draw from the results? A. A function needs to be included in the SELECT statement to achieve the desired results. B. The order of the operations in the calculation needs to be changed to achieve the required results. C. The results provide more information than management requested. D. Only the required results are displayed. Answer: D QUESTION NO: 57 Which statement would you use to add a primary key constraint to the patient table using the id_number column, immediately enabling the constraint? A. ALTER TABLE patient ADD (id_number CONSTRAINT pat_id_pk PRIMARY KEY); B. ALTER TABLE patient MODIFY (id_number CONSTRAINT pat_id_pk PRIMARY KEY); C. This task cannot be accomplished. D. ALTER TABLE patient ADD CONSTRAINT pat_id_pk PRIMARY KEY(id_number); Answer: D QUESTION NO: 58 You need to analyze how long your orders take to be shipped from the date that the order is placed. To do this, you must create a report that displays the customer number, date ordered, date shipped, and the number of months in whole numbers from the time the order is placed to the time the order is shipped. Which statement produces the required results? A. SELECT custid, orderdate, shipdate, ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken" FROM ord; B. SELECT custid, orderdate, shipdate, ROUNDOFF(shipdate - orderdate) "Time Taken" FROM ord; C. SELECT custid, orderdate, shipdate, MONTHS_BETWEEN (shipdate, orderdate)"Time Taken" "Pass Any Exam. Any Time." - Guaranteed 32
  • 32. Oracle 1z0-001: Practice Exam FROM ord; D. SELECT custid, orderdate, shipdate, ROUND(MONTHS_BETWEEN (shipdate, orderdate)) "Time Taken" FROM ord; Answer: D QUESTION NO: 59 In which situation should you use an outer join query? A. The employee table column corresponding to the region table column contains null values for rows that need to be displayed. B. The employee table has two columns that correspond. C. The employee and region tables have corresponding columns. D. The employee and region tables have no corresponding columns. Answer: A QUESTION NO: 60 Evaluate this IF statement: IF v_value > 100 THEN v_new_value := 2 * v_value; ELSIF v_value > 200 THEN v_new_value := 3 * v_value; ELSIF v_value < 300 THEN v_new_value := 4 * v_value; ELSE v_new_value := 5 * v_value; END IF; What would be assigned to V_NEW_VALUE if V_VALUE is 250? A. 500 B. 750 C. 250 D. 1000 E. 1250 "Pass Any Exam. Any Time." - Guaranteed 33
  • 33. Oracle 1z0-001: Practice Exam Answer: A QUESTION NO: 61 Evaluate this SQL script: CREATE ROLE manager; CREATE ROLE clerk; CREATE ROLE inventory; CREATE USER scott IDENTIFIED BY tiger; GRANT inventory TO clerk; GRANT clerk TO manager; GRANT inventory TO scott / How many roles will user SCOTT have access to? A. 3 B. 1 C. 0 D. 2 Answer: B QUESTION NO: 62 Which is NOT an SQL*Plus command? A. DESCRIBE B. CHANGE C. LIST D. UPDATE E. ACCEPT Answer: D QUESTION NO: 63 You attempt to query the database with this command: SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) "Pass Any Exam. Any Time." - Guaranteed 34
  • 34. Oracle 1z0-001: Practice Exam FROM employee WHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60 GROUP BY dept_no ORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date)); Why does this statement cause an error? A. A SELECT clause cannot contain a group function. B. An ORDER BY clause cannot contain a group function. C. A group function cannot contain a single row function. D. A WHERE clause cannot be used to restrict groups. Answer: D QUESTION NO: 64 The EMPLOYEE table contains these columns: ID NUMBER(9) LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) COMMISSION NUMBER(7,2) You need to display the current commission for all employees. These are the desired results: 1.Display the commission multiplied by 1.5. 2.Exclude employees with a zero commission. 3.Display a zero for employees with a null commission value. Evaluate this SQL command: SELECT id, last_name, first_name, commission * 1.5 FROM employee WHEREcommission <> 0; What does the statement provide? A. one of the desired results B. a syntax error C. all of the desired results D. two of the desired results "Pass Any Exam. Any Time." - Guaranteed 35
  • 35. Oracle 1z0-001: Practice Exam Answer: D QUESTION NO: 65 You issue this command: CREATE SYNONYM emp FOR ed.employee; Which task has been accomplished? A. The need to qualify an object name with its schema was eliminated for all users. B. The need to qualify an object name with its schema was eliminated for user Ed. C. The need to qualify an object name with its schema was eliminated for only you. D. The need to qualify an object name with its schema was eliminated for users with access. Answer: C QUESTION NO: 66 Evaluate this SQL script: CREATE ROLE manager; CREATE ROLE clerk; CREATE ROLE inventory; CREATE USER scott IDENTIFIED BY tiger; GRANT inventory TO clerk; GRANT clerk TO manager; GRANT inventory TO scott / How many roles will user SCOTT have access to? A. 2 B. 3 C. 0 D. 1 Answer: D "Pass Any Exam. Any Time." - Guaranteed 36
  • 36. Oracle 1z0-001: Practice Exam QUESTION NO: 67 Evaluate this PL/SQL block: BEGIN FOR i IN 1..5 LOOP IF i = 1 THEN null; ELSIF i = 3 THEN COMMIT; ELSIF i = 5 THEN ROLLBACK; ELSE INSERT INTO test(results) VALUES(i); END IF; END LOOP; COMMIT; END; How many values will be permanently inserted into the TEST table? A. 2 B. 1 C. 5 D. 0 E. 6 F. 3 Answer: B QUESTION NO: 68 You need to store currency data and you know that the data will always have two digits to the right of the decimal point. However, the number of digits to the left of the decimal place will vary greatly. Which datatype would be most appropriate to store this data? A. LONG B. NUMBER C. LONG RAW D. NUMBER(p) Answer: B QUESTION NO: 69 "Pass Any Exam. Any Time." - Guaranteed 37
  • 37. Oracle 1z0-001: Practice Exam Examine the structure of the STUDENT table: Name Null? Type ------------- ----------------- ------------- STUD_ID NOT NULL NUMBER(3) NAME VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Currently, the table is empty. You have decided that NULL values should not be allowed for NAME column. Which statement restricts NULL values from being entered into the column? A. ALTER TABLE student ADD CONSTRAINT name(NOT NULL); B. ALTER TABLE student ADD CONSTRAINT NOT NULL(name); C. ALTER TABLE student MODIFY (name varchar2(25) NOT NULL); D. ALTER TABLE student MODIFY CONSTRAINT name(NOT NULL); Answer: C QUESTION NO: 70 Evaluate this PL/SQL block: BEGIN FOR i IN 1..10 LOOP IF i = 4 OR i = 6 THEN null; ELSE INSERT INTO test(results) VALUES (I); END IF; COMMIT; END LOOP; ROLLBACK; END; "Pass Any Exam. Any Time." - Guaranteed 38
  • 38. Oracle 1z0-001: Practice Exam How many values will be inserted into the TEST table? A. 4 B. 8 C. 0 D. 10 E. 6 Answer: B QUESTION NO: 71 You attempt to create the salary table with this command: 1.CREATE TABLE salary 2.(employee_idNUMBER(9) 3.CONSTRAINT salary_pk PRIMARY KEY, 4.1995_salaryNUMBER(8,2), 5.manager_nameVARCHAR2(25) 6.CONSTRAINT mgr_name_nn NOT NULL, 7.$salary_96NUMBER(8,2)); Which two lines of this statement will return errors? (Choose two.) A. 4 B. 5 C. 7 D. 3 E. 2 F. 1 Answer: A,C QUESTION NO: 72 Which statement about using a subquery in the FROM clause is true? A. You define a data source for future SELECT statements when using a subquery in the FROM clause. B. You eliminate the need to create a new view or table by placing a subquery in the FROM clause. "Pass Any Exam. Any Time." - Guaranteed 39
  • 39. Oracle 1z0-001: Practice Exam C. You eliminate the need to grant SELECT privileges on the table used in the FROM clause subquery. D. You cannot use a subquery in the FROM clause. Answer: B QUESTION NO: 73 In which order does the Oracle Server evaluate clauses? A. WHERE, GROUP BY, HAVING B. WHERE, HAVING, GROUP BY C. HAVING, WHERE, GROUP BY D. GROUP BY, HAVING, WHERE Answer: A QUESTION NO: 74 You need to change the job title 'Clerk' to 'Administrative Clerk' for all clerks. Which statement does this? A. UPDATE emp SET VALUES job = 'Administrative Clerk' WHERE UPPER(job) = 'CLERK'; B. UPDATE emp SET job = 'Administrative Clerk'; C. UPDATE emp job := 'Administrative Clerk' WHERE UPPER(job) = 'CLERK'; D. UPDATE emp SET job = 'Administrative Clerk' WHERE UPPER(job) = 'CLERK'; Answer: D QUESTION NO: 75 Examine the structure of the STUDENT table: Name Null? Type ----------------- ------------- ------------ "Pass Any Exam. Any Time." - Guaranteed 40
  • 40. Oracle 1z0-001: Practice Exam STUD_ID NOT NULL NUMBER(3) NAME VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Currently, the table is empty. You have decided that NULL values should not be allowed for NAME column. Which statement restricts NULL values from being entered into the column? A. ALTER TABLE student MODIFY (name varchar2(25) NOT NULL); B. ALTER TABLE student ADD CONSTRAINT name(NOT NULL); C. ALTER TABLE student ADD CONSTRAINT NOT NULL(name); D. ALTER TABLE student MODIFY CONSTRAINT name(NOT NULL); Answer: A QUESTION NO: 76 Click on the EXHIBIT button and examine the table instance chart for the cars table. You query the database with this command: SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available" FROM cars WHERE model = 'Fire' GROUP BY lot_no HAVING COUNT(*) > 10 ORDER BY COUNT(*); Which clause restricts which groups are displayed? "Pass Any Exam. Any Time." - Guaranteed 41
  • 41. Oracle 1z0-001: Practice Exam A. HAVING COUNT(*) > 10 B. WHERE model = 'Fire' C. GROUP BY lot_no D. ORDER BY COUNT(*) E. SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available" Answer: A QUESTION NO: 77 Which privilege concerns system level security? A. DROP ANY TABLE B. INDEX C. DELETE D. UPDATE E. ALTER Answer: A QUESTION NO: 78 Which statement is valid within the executable section of a PL/SQL block? A. WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('No records found'); B. SELECT ename, sal INTO v_ename, v_sal FROM emp WHERE empno = 101; C. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) IS BEGIN IF n1 > n2 THEN "Pass Any Exam. Any Time." - Guaranteed 42
  • 42. Oracle 1z0-001: Practice Exam p_max := n1; ELSE p_max := n2; END; D. BEGIN emp_rec emp%ROWTYPE; END; Answer: B QUESTION NO: 79 A DBA has updated Smith's account by adding the privileges CREATE ANY TABLE and CREATE PROCEDURE. Which tasks can Smith successfully perform? A. Smith can create a table in any schema of the database but can drop tables from and create procedures only in his schema. B. Smith can create any table or procedure only in his schema. Also, he can drop any table only from his schema. C. Smith can create tables, drop tables and create procedures in any schema of the database. D. Smith can create a table or a procedure in any schema of the database. Also, he can drop a table in any schema of the database. Answer: A QUESTION NO: 80 Which script would you use to query the data dictionary to view only the name of the primary key constraints by using a substitution parameter for the table name? A. ACCEPT table PROMPT 'Table to view primary key constraint: ' SELECT constraint_name FROM user_constraints WHERE table_name = UPPER('&table') AND constraint_type = 'PRIMARY'; B. ACCEPT table PROMPT 'Table to view primary key constraint: ' SELECT constraint_name FROM user_cons_columns WHERE table_name = UPPER('&table') AND constraint_type = 'P'; C. ACCEPT table PROMPT 'Table to view primary key constraint: ' SELECT constraint_name, constraint_type FROM user_constraints WHERE table_name = UPPER('&table'); "Pass Any Exam. Any Time." - Guaranteed 43
  • 43. Oracle 1z0-001: Practice Exam D. ACCEPT table PROMPT 'Table to view primary key constraint: ' SELECT constraint_name FROM user_constraints WHERE table_name = UPPER('&table') AND constraint_type = 'P'; Answer: D QUESTION NO: 81 The EMPLOYEE table contains these columns: ID NUMBER(9) PK LAST_NAME VARCHAR2(25)NN DEPT_ID NUMBER(9) Evaluate this SQL script: DEFINE id_2 = 93004 SELECT * FROMemployee WHEREid = (&id_2) / Which change should you make to the script so that it will execute? A. Remove the ampersand. B. Use the ACCEPT command. C. Add single quotation marks. D. No change is needed. Answer: D QUESTION NO: 82 Which ALTER command would you use to reinstate a disabled primary key constraint? A. ALTER TABLE cars ENABLE CONSTRAINT cars_id_pk; B. ALTER TABLE cars ADD CONSTRAINT cars_id_pk PRIMARY KEY (id); C. ALTER TABLE cars ENABLE PRIMARY KEY (id) CASCADE; D. ALTER TABLE cars ENABLE PRIMARY KEY (id); "Pass Any Exam. Any Time." - Guaranteed 44
  • 44. Oracle 1z0-001: Practice Exam Answer: A QUESTION NO: 83 You need to retrieve the employee names and salaries from your EMP table sorted by salary in descending order. If two names match for a salary, the names must be displayed in alphabetical order. Which statement produces the required results? A. SELECT ename, sal FROM EMP ORDER BY ename, sal; B. SELECT ename, sal FROM EMP ORDER BY sal DESC, ename ASCENDING; C. SELECT ename, sal FROM EMP ORDER BY sal, ename; D. SELECT ename, sal FROM EMP ORDER BY sal DESC, ename; E. SELECT ename, sal FROM EMP SORT BY sal DESC, ename; Answer: D QUESTION NO: 84 The EMPLOYEE table contains these columns: FIRST_NAMEVARCHAR2(25) COMMISSION NUMBER(3,2) Evaluate this SQL statement: SELECT first_name, commission FROM employee WHERE commission = (SELECTcommission FROMemployee WHEREUPPER(first_name) = 'SCOTT') "Pass Any Exam. Any Time." - Guaranteed 45
  • 45. Oracle 1z0-001: Practice Exam What would cause this statement to fail? A. There is more than one employee with the first name Scott. B. The FIRST_NAME values in the database are in lowercase. C. Scott has a NULL commission value. D. Scott has a zero commission value. E. There is no employee with the first name Scott. Answer: A QUESTION NO: 85 In SQL*Plus, you issued this command: DELETE FROM dept WHERE dept_id = 901; You received an integrity constraint error because a child record was found. What could you do to make the statement execute? A. Add the CONSTRAINTS CASCADE option to the command. B. Add the FORCE keyword to the command. C. You cannot make the command execute. D. Delete the child records first. Answer: D QUESTION NO: 86 You want to create a report to show different jobs in each department. You do not want to display any duplicate rows in the report. Which SELECT statement do you use to create the report? A. SELECT deptno, job FROM EMP; B. SELECT NODUPLICATE deptno, job FROM EMP; C. SELECT DISTINCT deptno, job FROM EMP; D. CREATE REPORT DISPLAY deptno, job FROM EMP; E. SELECT DISTINCT deptno, DISTINCT job FROM EMP; "Pass Any Exam. Any Time." - Guaranteed 46
  • 46. Oracle 1z0-001: Practice Exam Answer: C QUESTION NO: 87 Which should you do after each FETCH statement in a PL/SQL block? A. Open the cursor. B. Initialize the loop. C. Close the cursor. D. Test for rows using a cursor attribute. Answer: D QUESTION NO: 88 Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE tables. Evaluate this SQL statement: CREATE INDEX emp_dept_id_idx ON employee(dept_id); Which result will the statement provide? A. Increase the chance of full table scans. B. May reduce the amount of disk I/O for SELECT statements. C. May reduce the amount of disk I/O for INSERT statements. D. Store an index in the EMPLOYEE table. E. Override the unique index created when the FK relationship was defined. Answer: B "Pass Any Exam. Any Time." - Guaranteed 47
  • 47. Oracle 1z0-001: Practice Exam QUESTION NO: 89 Your company wants to give each employee a $100 salary increment. You need to evaluate the results from the EMP table prior to the actual modification. If you do not want to store the results in the database, which statement is valid? A. You need to give the arithmetic expression that involves the salary increment in the UPDATE clause of the SELECT statement. B. You need to give the arithmetic expression that involves the salary increment in the SET clause of the UPDATE statement. C. You need to add a column to the EMP table. D. You need to give the arithmetic expression that involves the salary increment in the SELECT clause of the SELECT statement. E. You need to give the arithmetic expression that involves the salary increment in the DISPLAY clause of the SELECT statement. Answer: D QUESTION NO: 90 Click on the EXHIBIT button and examine the table instance chart for the patient table. You created the patient_vu view based on id_number and last_name from the patient table. What is the best way to modify the view to contain only those patients born in 1997? A. Replace the view adding a WHERE clause. B. Drop the patient_vu, then create a new view with a HAVING clause. C. Drop the patient_vu, then create a new view with a WHERE clause. D. Use the ALTER command to add a WHERE clause to verify the time. Answer: A QUESTION NO: 91 "Pass Any Exam. Any Time." - Guaranteed 48
  • 48. Oracle 1z0-001: Practice Exam Examine the structure of the STUDENT table: Name Null? Type ------------- ----------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Graduation column is a foreign key column to the GRADDATE table. Examine the data in the GRADDATE table: GRADUATION -------------- 20-JAN-1999 12-MAY-1999 19-JAN-2000 25-MAY-2000 13-JAN-2001 29-MAY-2001 Which update statement produces the following error? ORA-02291: integrity constraint (SYS_C23) violated - parent key not found A. UPDATE student SET name = 'Smith', graduation = '29-MAY-2001' WHERE stud_id = 101; B. UPDATE student SET name = 'Smith', graduation = '15-AUG-2000' WHERE stud_id = 101; C. UPDATE student SET stud_id = 999, graduation = '29-MAY-2001' WHERE stud_id = 101; D. UPDATE student SET stud_id = NULL, address = '100 Main Street' WHERE graduation = '20-JAN-1999'; "Pass Any Exam. Any Time." - Guaranteed 49
  • 49. Oracle 1z0-001: Practice Exam Answer: B QUESTION NO: 92 Examine this block of code: SET SERVEROUTPUT ON DECLARE x NUMBER; v_sal NUMBER; v_found VARCHAR2(10) := 'TRUE'; BEGIN x := 1; v_sal := 1000; DECLARE v_found VARCHAR2(10); y NUMBER; BEGIN IF (v_sal > 500) THEN v_found := 'YES'; END IF; DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found); DBMS_OUTPUT.PUT_LINE ('Value of v_sal is '|| v_sal); y := 20; END; DBMS_OUTPUT.PUT_LINE ('Value of v_found is '|| v_found); DBMS_OUTPUT.PUT_LINE ('Value of Y is '|| TO_CHAR(y)); END; SET SERVEROUTPUT OFF Why does this code produce an error when executed? A. The value of V_FOUND cannot be 'YES'. B. Variable Y is declared in the inner block and referenced in the outer block. C. Variable V_FOUND is declared at more than one location. D. Variable V_SAL is declared in the outer block and referenced in the inner block. Answer: B QUESTION NO: 93 "Pass Any Exam. Any Time." - Guaranteed 50
  • 50. Oracle 1z0-001: Practice Exam Click on the EXHIBIT button and examine the table instance chart for the employee table. You want to display each employee's hire date from earliest to latest. Which SQL statement would you use? A. SELECT hire_date FROM employee; B. SELECT hire_date FROM employee ORDER BY hire_date DESC; C. SELECT hire_date FROM employee ORDER BY hire_date; D. SELECT hire_date FROM employee GROUP BY hire_date; Answer: C QUESTION NO: 94 In which section of a PL/SQL block is a user-defined exception raised? A. heading B. declarative C. executable D. exception handling Answer: C QUESTION NO: 95 Examine the declaration section: "Pass Any Exam. Any Time." - Guaranteed 51
  • 51. Oracle 1z0-001: Practice Exam DECLARE CURSOR emp_cursor(p_deptno NUMBER, p_job VARCHAR2) IS SELECT empno, ename FROM emp WHERE deptno = p_deptno AND job = p_job; BEGIN ... Which statement opens this cursor successfully? A. OPEN emp_cursor('Clerk', 10); B. OPEN emp_cursor; C. OPEN emp_cursor(p_deptno, p_job); D. OPEN emp_cursor(10,'Analyst'); Answer: D QUESTION NO: 96 The EMPLOYEE table has ten columns. Since you often query the table with conditions based on four or more columns, you created an index on all the columns in the table. Which result will occur? A. The speed of inserts will be increased. B. Updates on the table will be slower. C. The size of the EMPLOYEE table will be increased. D. All queries on the table will be faster. Answer: B QUESTION NO: 97 Which SELECT statement would you use in a PL/SQL block to query the employee table and retrieve the last name and salary of the employee whose id is 3? A. SELECT last_name, salary INTO v_last_name, v_salary FROM employee WHERE id = 3; "Pass Any Exam. Any Time." - Guaranteed 52
  • 52. Oracle 1z0-001: Practice Exam B. SELECT last_name, salary FROM employee INTO v_last_name, v_salary WHERE id = 3; C. SELECT last_name, salary FROM employee WHERE id = 3; D. SELECT last_name, salary FROM employee; Answer: A QUESTION NO: 98 Examine the table structures: EMP Table Name Null? Type ------------------------------- ----------------- ----------- EMPNO NOT NULL NUMBER(4) NAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SALARY NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NOT NULL NUMBER(2) TAX Table Name Null? Type ------------------------------- ---------- -------- TAXGRADE NUMBER LOWSAL NUMBER HIGHSAL NUMBER You want to create a report that displays the employee details along with the tax category of each employee. The tax category is determined by comparing the salary of the employee from the EMP table to the lower and upper salary values in the TAX table. Which SELECT statement produces the required results? A. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t "Pass Any Exam. Any Time." - Guaranteed 53
  • 53. Oracle 1z0-001: Practice Exam WHERE e.salary BETWEEN t.lowsal AND t.highsal; B. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary <= t.lowsal AND e.salary >= t.highsal; C. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary IN t.lowsal AND t.highsal; D. SELECT e.name, e.salary, t.taxgrade FROM emp e, tax t WHERE e.salary >= t.lowsal AND <= t.highsal; Answer: A QUESTION NO: 99 Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE tables. Evaluate this SQL statement: CREATE INDEX emp_dept_id_idx ON employee(dept_id); Which result will the statement provide? A. May reduce the amount of disk I/O for SELECT statements. B. May reduce the amount of disk I/O for INSERT statements. C. Increase the chance of full table scans. D. Store an index in the EMPLOYEE table. E. Override the unique index created when the FK relationship was defined. Answer: A "Pass Any Exam. Any Time." - Guaranteed 54
  • 54. Oracle 1z0-001: Practice Exam QUESTION NO: 100 You attempt to create the salary table with this command: 1.CREATE TABLE salary 2.(employee_idNUMBER(9) 3.CONSTRAINT salary_pk PRIMARY KEY, 4.1995_salaryNUMBER(8,2), 5.manager_nameVARCHAR2(25) 6.CONSTRAINT mgr_name_nn NOT NULL, 7.$salary_96NUMBER(8,2)); Which two lines of this statement will return errors? (Choose two.) A. 3 B. 2 C. 1 D. 7 E. 4 F. 5 Answer: D,E QUESTION NO: 101 Click on the EXHIBIT button and examine the table instance chart for the cars table. Which SELECT statement will display style, color, and lot number for all cars based on the model entered at the prompt, regardless of case? A. SELECT style, color, lot_no FROM cars WHERE model = '&model'; "Pass Any Exam. Any Time." - Guaranteed 55
  • 55. Oracle 1z0-001: Practice Exam B. SELECT style, color, lot_no FROM cars WHERE UPPER(model) = '&model'; C. SELECT style, color, lot_no FROM cars WHERE UPPER(model) = UPPER('&model'); D. SELECT style, color, lot_no FROM cars WHERE model = UPPER('&model'); Answer: C QUESTION NO: 102 Examine the structure of the STUDENT table: Name Null? Type ---------------- -------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Which statement inserts a new row into the STUDENT table? A. INSERT INTO student VALUES (101,'Smith'); B. INSERT INTO student (stud_id, address, graduation) VALUES (101,'100 Main Street','17-JUN-99'); C. INSERT INTO student (stud_id, address, name, graduation) VALUES (101,'100 Main Street','Smith','17-JUN-99'); D. INSERT INTO student table VALUES (101,'Smith','100 Main Street','17-JUN-99'); E. INSERT INTO student VALUES (101,'100 Main Street','17-JUN-99','Smith'); Answer: C QUESTION NO: 103 You need to store currency data and you know that the data will always have two digits to the right of the decimal point. However, the number of digits to the left of the decimal place will vary greatly. "Pass Any Exam. Any Time." - Guaranteed 56
  • 56. Oracle 1z0-001: Practice Exam Which datatype would be most appropriate to store this data? A. LONG B. LONG RAW C. NUMBER(p) D. NUMBER Answer: D QUESTION NO: 104 You need to remove all the data from the employee table while leaving the table definition intact. You want to be able to undo this operation. How would you accomplish this task? A. TRUNCATE TABLE employee; B. DELETE FROM employee; C. This task cannot be accomplished. D. DROP TABLE employee; Answer: B QUESTION NO: 105 Click on the EXHIBIT button and examine the employee table. You create a view with this command: CREATE VIEW dept_salary_vu AS SELECT dept_no, salary, last_name FROM employee WHERE salary > 45000 WITH CHECK OPTION; For which employee can you update the dept_no column? "Pass Any Exam. Any Time." - Guaranteed 57
  • 57. Oracle 1z0-001: Practice Exam A. Southall B. none C. Chiazza D. Brown Answer: C QUESTION NO: 106 The PLAYER table contains these columns: ID NUMBER(9) NAME VARCHAR(2) MANAGER_ID NUMBER(9) In this instance, managers are players and you need to display a list of players. Evaluate these two SQL statements: SELECT p.name, m.name FROMplayer p, player m WHEREm.id = p.manager_id; SELECT p.name, m.name FROMplayer p, player m WHEREm.manager_id = p.id; How will the results differ? A. Statement 1 will not execute; statement 2 will. "Pass Any Exam. Any Time." - Guaranteed 58
  • 58. Oracle 1z0-001: Practice Exam B. Statement 1 is self-join; statement 2 is not. C. Statement 1 will execute; statement 2 will not. D. The results will be the same, but the display will be different. Answer: D QUESTION NO: 107 You attempt to query the database with this command: SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) FROM employee WHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60 GROUP BY dept_no ORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date)); Why does this statement cause an error? A. A SELECT clause cannot contain a group function. B. An ORDER BY clause cannot contain a group function. C. A group function cannot contain a single row function. D. A WHERE clause cannot be used to restrict groups. Answer: D QUESTION NO: 108 Evaluate this PL/SQL block: DECLARE v_result NUMBER(2); BEGIN DELETE FROM employee WHERE dept_id IN (10, 20, 30); v_result := SQL%ROWCOUNT; COMMIT; END; What will be the value of V_RESULT if no rows are deleted? "Pass Any Exam. Any Time." - Guaranteed 59
  • 59. Oracle 1z0-001: Practice Exam A. 0 B. NULL C. FALSE D. 1 E. TRUE Answer: A QUESTION NO: 109 Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.) A. The SELECT statement does not have a WHERE clause. B. The SELECT statement contains a GROUP BY clause. C. The SELECT statement does not return a row. D. The SELECT statement returns more than one row. E. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause. Answer: C,D QUESTION NO: 110 The structure of the DEPT table is as follows: Name Null? Type ------------------------------- -------------- --------- DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) Examine the code: DECLARE dept_rec dept%ROWTYPE; BEGIN SELECT * INTO dept_rec FROM dept WHERE deptno = 10; END; Which PL/SQL statement displays the location of the selected department? "Pass Any Exam. Any Time." - Guaranteed 60
  • 60. Oracle 1z0-001: Practice Exam A. DBMS_OUTPUT.PUT_LINE (dept_rec.loc); B. DBMS_OUTPUT.PUT_LINE (dept_rec); C. You cannot display a single field in the record because they are not explicitly identified in the declarative section. D. DBMS_OUTPUT.PUT_LINE (dept_rec(1).loc); Answer: A QUESTION NO: 111 Which SELECT statement displays employee names, salaries, department numbers, and average salaries for all employees who earn more than the average salary in their department? A. SELECT outer.ename,outer.sal,outer.deptno,AVG(outer.sal) FROM emp outer GROUP BY outer.ename, outer.sal, outer.deptno HAVING AVG(outer.sal) IN (SELECT inner.sal FROM emp inner WHERE inner.deptno = outer.deptno); B. SELECT outer.ename,outer.sal, outer.deptno,AVG(outer.sal) FROM emp outer GROUP BY outer.ename, outer.sal, outer.deptno HAVING AVG(outer.sal) > (SELECT inner.sal FROM emp inner WHERE inner.deptno = outer.deptno); C. SELECT ename, sal, deptno, AVG(sal) FROM emp GROUP BY ename, sal, deptno; D. SELECT a.ename, a.sal, a.deptno, b.salavg FROM emp a, (SELECT deptno, AVG(sal) salavg FROM emp GROUP BY deptno) b WHERE a.deptno = b.deptno AND a.sal > b.salavg; Answer: D QUESTION NO: 112 "Pass Any Exam. Any Time." - Guaranteed 61
  • 61. Oracle 1z0-001: Practice Exam You need to execute a script file named QUERYEMP.SQL from your SQL*Plus environment. Which command do you use? A. START QUERYEMP B. RUN QUERYEMP C. GET QUERYEMP D. EXECUTE QUERYEMP Answer: A QUESTION NO: 113 You need to create a PL/SQL program to insert records into the employee table. Which block of code successfully uses the INSERT command? A. DECLARE v_hiredate DATE := SYSDATE; BEGIN INSERT INTO emp(empno, ename, hiredate, deptno) (empno_sequence.nextval, '&name', v_hiredate, &deptno); END; B. DECLARE v_hiredate DATE := SYSDATE; BEGIN INSERT INTO emp(empno, ename, hiredate, deptno) VALUES(empno_sequence.nextval, '&name', v_hiredate, &deptno); END; C. DECLARE v_hiredate DATE := SYSDATE; BEGIN INSERT INTO emp(empno, ename, hiredate, deptno) VALUES(empno_sequence.nextval, '&name', v_hiredate, &deptno) WHERE job = 'CLERK'; END; D. DECLARE v_hiredate DATE := SYSDATE; BEGIN INSERT INTO emp(empno, ename, hiredate) VALUES(empno_sequence.nextval, '&name', v_hiredate, "Pass Any Exam. Any Time." - Guaranteed 62
  • 62. Oracle 1z0-001: Practice Exam &deptno); END; Answer: B QUESTION NO: 114 Which SELECT statement displays the order id, product id, and quantity of items in the ITEM table that match both the product id and quantity of an item in order 605? (Do not display the details for order 605.) A. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHERE ordid = 605) AND ordid <> 605; B. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) = (SELECT prodid, qty FROM item WHERE ordid = 605) AND ordid <> 605; C. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHERE ordid = 605); D. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT ordid, prodid, qty FROM item WHERE ordid = 605) AND ordid <> 605; Answer: A "Pass Any Exam. Any Time." - Guaranteed 63
  • 63. Oracle 1z0-001: Practice Exam QUESTION NO: 115 Evaluate this PL/SQL block: BEGIN FOR i IN 1..10 LOOP IF i = 4 OR i = 6 THEN null; ELSE INSERT INTO test(results) VALUES (I); END IF; COMMIT; END LOOP; ROLLBACK; END; How many values will be inserted into the TEST table? A. 8 B. 10 C. 4 D. 6 E. 0 Answer: A QUESTION NO: 116 You create the sale table with this command: CREATE TABLE sale (purchase_no NUMBER(9) CONSTRAINT sale_purchase_no_pk PRIMARY KEY, customer_id NUMBER(9) CONSTRAINT sale_customer_id_fk REFERENCES customer (id) CONSTRAINT sale_customer_id_nn NOT NULL); Which index or indexes are created for this table? A. No indexes are created for this table. "Pass Any Exam. Any Time." - Guaranteed 64
  • 64. Oracle 1z0-001: Practice Exam B. An index is created for each column. C. An index is created for the customer_id column. D. An index is created for the purchase_no column. Answer: D QUESTION NO: 117 Click on the EXHIBIT button and examine the table instance chart for the patient table. You created the patient_id_seq sequence to be used with the patient table's primary key column. The sequence begins at 1000, has a maximum value of 999999999, and increments by 1. You need to write a script to insert a row into the patient table and use the sequence you created. Which script would you use to complete this task? A. INSERT INTO patient (id_number, last_name, first_name, birth_date) VALUES (patient_id_seq, last_name, first_name, birth_date) / B. INSERT INTO patient (id_number, last_name, first_name, birth_date) VALUES (patient_id_seq.NEXTVAL, &last_name, &first_name, &birth_date) / C. INSERT INTO patient (id_number, last_name, first_name, birth_date) VALUES (patient_id_seq.NEXTVALUE, &last_name, &first_name, &birth_date) / D. INSERT INTO patient (id_number) VALUES (patient_id_seq.NEXTVALUE) / E. This task cannot be accomplished. F. INSERT INTO patient (id_number, last_name, first_name, birth_date) VALUES (patient_id_seq.CURRVAL, &last_name, &first_name, &birth_date) / Answer: B "Pass Any Exam. Any Time." - Guaranteed 65
  • 65. Oracle 1z0-001: Practice Exam QUESTION NO: 118 How do you send the output of your SQL*Plus session to a text operating system file called MYOUTPUT.LST? A. SAVE myoutput.lst B. SPOOL myoutput.lst C. PRINT myoutput.lst D. SENDOUTPUT myoutput.lst Answer: B QUESTION NO: 119 You need to analyze how long your orders take to be shipped from the date that the order is placed. To do this, you must create a report that displays the customer number, date ordered, date shipped, and the number of months in whole numbers from the time the order is placed to the time the order is shipped. Which statement produces the required results? A. SELECT custid, orderdate, shipdate, ROUNDOFF(shipdate - orderdate) "Time Taken" FROM ord; B. SELECT custid, orderdate, shipdate, MONTHS_BETWEEN (shipdate, orderdate)"Time Taken" FROM ord; C. SELECT custid, orderdate, shipdate, ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken" FROM ord; D. SELECT custid, orderdate, shipdate, ROUND(MONTHS_BETWEEN (shipdate, orderdate)) "Time Taken" FROM ord; Answer: D QUESTION NO: 120 The EMPLOYEE table contains these columns: BONUSNUMBER(7,2) "Pass Any Exam. Any Time." - Guaranteed 66
  • 66. Oracle 1z0-001: Practice Exam DEPT_ID NUMBER(9) There are 10 departments and each department has at least 1 employee. Bonus values are greater than 500; not all employees receive a bonus. Evaluate this PL/SQL block: DECLARE v_bonusemployee.bonus%TYPE := 300; BEGIN UPDATE employee SET bonus = bonus + v_bonus WHERE dept_id IN (10, 20, 30); COMMIT; END; What will be the result? A. A subset of employees will be given a 300 bonus. B. All employees will be given a 300 increase in bonus. C. A subset of employees will be given a 300 increase in bonus. D. All employees will be given a 300 bonus. Answer: C QUESTION NO: 121 The view EMP_VIEW is created based on the table EMP as follows: CREATE OR REPLACE VIEW emp_view AS SELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMP FROM emp GROUP BY deptno; What happens when the following command is issued? UPDATE emp_view SET tot_sal = 20000 WHERE deptno = 10; A. The base table can not be updated through this view. "Pass Any Exam. Any Time." - Guaranteed 67
  • 67. Oracle 1z0-001: Practice Exam B. The SAL column in the EMP table is updated to 20000 for employees in department 10. C. The TOT_SAL column in EMP table is updated to 20000 for department 10. D. The TOT_SAL column in EMP_VIEW view is updated to 20000 for department 10. Answer: A QUESTION NO: 122 In which order does the Oracle Server evaluate clauses? A. WHERE, HAVING, GROUP BY B. HAVING, WHERE, GROUP BY C. WHERE, GROUP BY, HAVING D. GROUP BY, HAVING, WHERE Answer: C QUESTION NO: 123 Click on the EXHIBIT button and examine the table instance chart for the cars table. Which SELECT statement will display style, color, and lot number for all cars based on the model entered at the prompt, regardless of case? A. SELECT style, color, lot_no FROM cars WHERE model = UPPER('&model'); B. SELECT style, color, lot_no FROM cars WHERE UPPER(model) = '&model'; C. SELECT style, color, lot_no FROM cars WHERE model = '&model'; "Pass Any Exam. Any Time." - Guaranteed 68
  • 68. Oracle 1z0-001: Practice Exam D. SELECT style, color, lot_no FROM cars WHERE UPPER(model) = UPPER('&model'); Answer: D QUESTION NO: 124 Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables. You issue this SQL statement: SELECT pr.name FROMpart pt, product pr WHEREpt.product_id(+) = pr.id; What is the result? A. A list of all products is displayed for products with parts. B. An error is generated. C. A list of all product names is displayed. D. A list of products is displayed for parts that have products assigned. Answer: C QUESTION NO: 125 The structure of the DEPT table is as follows: Name Null? Type ------------------------------- ---------- -------- DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) Examine the declaration section: "Pass Any Exam. Any Time." - Guaranteed 69
  • 69. Oracle 1z0-001: Practice Exam DECLARE TYPE dept_table_type IS TABLE OF dept%ROWTYPE INDEX BY BINARY_INTEGER; dept_table dept_table_type; You need to assign the LOC field in record 15, the value of 'Atlanta'. Which PL/SQL statement makes this assignment? A. dept_table.loc.15 := 'Atlanta'; B. dept_table(15).loc := 'Atlanta'; C. dept_table[15].loc := 'Atlanta'; D. dept_table_type(15).loc := 'Atlanta'; Answer: B QUESTION NO: 126 Evaluate these two SQL commands: 1.SELECT DISTINCT object_type FROM user_objects; 2.SELECTobject_type FROM all_objects; How will the results differ? A. Statement 1 will display the distinct object types owned by the user; statement 2 will display all the object types the user can access. B. Statement 1 will display the distinct object types owned by the user; statement 2 will display all the object types in the database. C. Statement 1 will display the distinct object types in the database; statement 2 will display all the object types in the database. D. Statement 1 will display the distinct object types that the user can access; statement 2 will display all the object types that the user owns. Answer: A QUESTION NO: 127 Which statement is valid within the executable section of a PL/SQL block? "Pass Any Exam. Any Time." - Guaranteed 70
  • 70. Oracle 1z0-001: Practice Exam A. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) IS BEGIN IF n1 > n2 THEN p_max := n1; ELSE p_max := n2; END; B. SELECT ename, sal INTO v_ename, v_sal FROM emp WHERE empno = 101; C. WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE ('No records found'); D. BEGIN emp_rec emp%ROWTYPE; END; Answer: B QUESTION NO: 128 You want to create a report that gives, per department, the number of employees and total salary as a percentage of all the departments. Examine the results from the report: Department %Employees %Salary --------------- ---------------- ------------- 10 21.43 30.15 2 0 35.71 37.47 30 42.86 32.39 Which SELECT statement produces the report? A. SELECT deptno "Department", (COUNT(*)/COUNT(empno)) * 100 "%Employees", (SUM(sal)/COUNT(*)) * 100 "%Salary" FROM scott.emp GROUP BY deptno; B. SELECT a.deptno "Department", ROUND(a.num_emp/b.total_count * 100, 2) "%Employees", "Pass Any Exam. Any Time." - Guaranteed 71
  • 71. Oracle 1z0-001: Practice Exam ROUND(a.sal_sum/b.total_sal * 100, 2) "%Salary" FROM (SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sum FROM scott.emp GROUP BY deptno) a, (SELECT COUNT(*) total_count, SUM(sal) total_sal FROM scott.emp) b; C. SELECT deptno "Department", PCT(empno) "%Employees", PCT(sal) "%Salary" FROM scott.emp GROUP BY deptno; D. SELECT a.deptno "Department", (a.num_emp/COUNT(*)) * 100 "%Employees", (a.sal_sum/COUNT(*)) * 100 "%Salary" FROM (SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sum FROM scott.emp GROUP BY deptno) a; Answer: B QUESTION NO: 129 Which privilege concerns system level security? A. INDEX B. DROP ANY TABLE C. DELETE D. UPDATE E. ALTER Answer: B QUESTION NO: 130 The view EMP_VIEW is created based on the table EMP as follows: CREATE OR REPLACE VIEW emp_view AS SELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMP FROM emp "Pass Any Exam. Any Time." - Guaranteed 72
  • 72. Oracle 1z0-001: Practice Exam GROUP BY deptno; What happens when the following command is issued? UPDATE emp_view SET tot_sal = 20000 WHERE deptno = 10; A. The SAL column in the EMP table is updated to 20000 for employees in department 10. B. The TOT_SAL column in EMP_VIEW view is updated to 20000 for department 10. C. The TOT_SAL column in EMP table is updated to 20000 for department 10. D. The base table can not be updated through this view. Answer: D QUESTION NO: 131 Click on the EXHIBIT button and examine the table instance chart for the patient table. You need to create the patient_id_seq sequence to be used with the patient table's primary key column. The sequence should begin at 1000, have a maximum value of 999999999, never reuse any numbers, and increment by 1. Which statement would you use to complete this task? A. CREATE SEQUENCE patient_id_seq START WITH 1000 MAXVALUE 999999999 STEP BY 1; B. This task cannot be accomplished. C. CREATE SEQUENCE patient_id_seq ON patient (patient_id) MINVALUE 1000 MAXVALUE 999999999 INCREMENT BY 1 "Pass Any Exam. Any Time." - Guaranteed 73
  • 73. Oracle 1z0-001: Practice Exam NOCYCLE; D. CREATE SEQUENCE patient_id_seq START WITH 1000 MAXVALUE 999999999 NOCYCLE; Answer: D QUESTION NO: 132 For which three tasks would you use the WHERE clause? (Choose three.) A. restrict the rows displayed B. display only data greater than a specified value C. restrict the output of a group function D. designate a table location E. display only unique data F. compare two values Answer: A,B,F QUESTION NO: 133 You have a view called ANN_SAL that is based on the EMPLOYEE table. The structure of the ANN_SAL view is: Name Null? Type ------------------------------- -------------- ---------- EMPNO NOT NULL NUMBER(4) YEARLY_SAL NUMBER(9,2) MONTHLY_SAL NUMBER(9,2) Which statement retrieves data from the ANN_SAL view? A. SELECT * FROM VIEW ann_sal BASEDON employee; B. SELECT * FROM EMPLOYEE; C. SELECT * FROM ann_sal; D. SELECT * FROM VIEW ann_sal; "Pass Any Exam. Any Time." - Guaranteed 74
  • 74. Oracle 1z0-001: Practice Exam Answer: C QUESTION NO: 134 The PLAYER table contains these columns: ID NUMBER(9) NAME VARCHAR(2) MANAGER_ID NUMBER(9) In this instance, managers are players and you need to display a list of players. Evaluate these two SQL statements: SELECT p.name, m.name FROMplayer p, player m WHEREm.id = p.manager_id; SELECT p.name, m.name FROMplayer p, player m WHEREm.manager_id = p.id; How will the results differ? A. The results will be the same, but the display will be different. B. Statement 1 will execute; statement 2 will not. C. Statement 1 will not execute; statement 2 will. D. Statement 1 is self-join; statement 2 is not. Answer: A QUESTION NO: 135 Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables. You issue this SQL statement: SELECT pr.name FROMpart pt, product pr WHEREpt.product_id(+) = pr.id; What is the result? "Pass Any Exam. Any Time." - Guaranteed 75
  • 75. Oracle 1z0-001: Practice Exam A. A list of products is displayed for parts that have products assigned. B. A list of all product names is displayed. C. A list of all products is displayed for products with parts. D. An error is generated. Answer: B QUESTION NO: 136 Which statement is true about nesting blocks? A. A variable defined in the inner block is visible in the outer blocks. B. A variable defined in the outer block is visible in the inner blocks. C. Variable names must be unique between blocks. D. A variable in an inner block may have the same name as a variable in an outer block only if the data types are different. Answer: B QUESTION NO: 137 Which statement about multiple column subqueries is true? A. A pairwise comparison produces a cross product. B. In a pairwise subquery, the values returned from the subquery are compared individually to the values in the outer query. C. In a non-pairwise subquery, the values returned from the subquery are compared as a group to the values in the outer query. D. A non-pairwise comparison produces a cross product. Answer: D QUESTION NO: 138 Examine the code: "Pass Any Exam. Any Time." - Guaranteed 76
  • 76. Oracle 1z0-001: Practice Exam SET SERVEROUTPUT ON DECLARE v_char_val VARCHAR2(100); BEGIN v_char_val := 'Hello World'; DBMS_OUTPUT.PUT_LINE(v_char_val); END; SET SERVEROUTPUT OFF This code is stored in a script file named myproc.sql. Which statement executes the code in the script file? A. EXECUTE myproc.sql B. RUN myproc.sql C. BEGIN myproc.sql END; D. myproc.sql E. START myproc.sql Answer: E QUESTION NO: 139 You want to display the average salary for departments 20 and 50, but only if those departments have an average salary of at least 2000. Which statement will produce the required results? A. SELECT deptno, AVG(sal) FROM emp GROUP BY deptno HAVING AVG(sal) >= 2000 AND deptno IN (20, 50); B. SELECT deptno, AVG(sal) FROM emp WHERE deptno IN (20, 50) GROUP BY deptno HAVING AVG(sal) >= 2000; C. SELECT deptno, AVG(sal) FROM emp WHERE deptno IN (20, 50) GROUP BY AVG(sal) HAVING AVG(sal) >= 2000; D. SELECT deptno, AVG(sal) FROM emp "Pass Any Exam. Any Time." - Guaranteed 77
  • 77. Oracle 1z0-001: Practice Exam WHERE deptno IN (20, 50) AND AVG(sal) >= 2000 GROUP BY deptno; Answer: B QUESTION NO: 140 Click on the EXHIBIT button and examine the employee table. You attempt to query the database with this command: SELECT dept_no, last_name, SUM(salary) FROM employee WHERE salary < 50000 GROUP BY dept_no ORDER BY last_name; Which clause causes an error? A. WHERE salary < 50000 B. FROM employee C. ORDER BY last_name D. GROUP BY dept_no Answer: D QUESTION NO: 141 "Pass Any Exam. Any Time." - Guaranteed 78
  • 78. Oracle 1z0-001: Practice Exam Given this CURSOR statement: DECLARE CURSOR query_cursor (v_salary) IS SELECT last_name, salary, dept_no FROM employee WHERE salary > v_salary; Why does this statement cause an error? A. A scalar datatype was not specified for the parameter. B. A WHERE clause is not allowed in a CURSOR statement. C. The INTO clause is missing from the SELECT statement. D. The parameter mode was not defined. Answer: A QUESTION NO: 142 Which three SQL arithmetic expressions return a date? (Choose three.) A. ('03-JUL-96' - '04-JUL-97') / 7 B. ('03-JUL-96' - '04-JUL-97') / 12 C. '03-JUL-96' + (12 / 24) D. '03-JUL-96' - '04-JUL-97' E. '03-JUL-96' + 7 F. '03-JUL-96' - 12 Answer: C,E,F QUESTION NO: 143 When selecting data, which statement is valid about projection? A. Projection allows you to choose columns. B. Projection allows you to choose rows. C. Projection allows you to join tables together. D. Projection allows you to add columns to a table. Answer: A "Pass Any Exam. Any Time." - Guaranteed 79
  • 79. Oracle 1z0-001: Practice Exam QUESTION NO: 144 Which statement describes the use of a group function? A. A group function produces one result from many rows per group. B. A group function produces one result from each row of the table. C. A group function produces a group of results from one row. D. A group function produces many results from many rows per group. Answer: A QUESTION NO: 145 Which datatype should you use for interest rates with varying and unpredictable decimal places, such as 1.234, 3.4, 5, and 1.23? A. NUMBER(p,s) B. LONG C. NUMBER Answer: C QUESTION NO: 146 The structure of the DEPT table is as follows: Name Null? Type ------------------------------- -------- ------- DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) Examine the code: DECLARE TYPE dept_record_type IS RECORD (dno NUMBER, name VARCHAR2(20)); dept_rec dept_record_type; BEGIN SELECT deptno, dname INTO dept_rec "Pass Any Exam. Any Time." - Guaranteed 80
  • 80. Oracle 1z0-001: Practice Exam FROM dept WHERE deptno = 10; END; Which statement displays the name of the selected department? A. DBMS_OUTPUT.PUT_LINE(dept_rec.name); B. DBMS_OUTPUT.PUT_LINE(dname); C. DBMS_OUTPUT.PUT_LINE(dept_rec.dname); D. DBMS_OUTPUT.PUT_LINE(name); E. DBMS_OUTPUT.PUT_LINE(dept_rec(name)); Answer: A QUESTION NO: 147 You need to create a report to display the ship date and order totals of your ORDER table. If the order has not been shipped, your report must display 'Not Shipped'. If the total is not available, your report must display 'Not Available'. In the ORDER table, the SHIPDATE column has a datatype of DATE. The TOTAL column has a datatype of NUMBER. Which statement do you use to create this report? A. SELECT ordid, NVL(shipdate, 'Not Shipped'), NVL(total,'Not Available') FROM order; B. SELECT ordid, shipdate "Not Shipped", total "Not Available" FROM order; C. SELECT ordid, NVL(TO_CHAR(shipdate), 'Not Shipped'), NVL(TO_CHAR(total),'Not Available') FROM order; D. SELECT ordid,TO_CHAR(shipdate, 'Not Shipped'), TO_CHAR(total,'Not Available') FROM order; Answer: C QUESTION NO: 148 "Pass Any Exam. Any Time." - Guaranteed 81
  • 81. Oracle 1z0-001: Practice Exam Examine the code: SELECT employee.ename FROM emp employee WHERE employee.empno NOT IN (SELECT manager.mgr FROM emp manager); What is the NOT IN operator equivalent to, in the above query? A. ALL B. !=ALL C. NOT LIKE D. != Answer: B QUESTION NO: 149 The PART table contains these columns: ID NUMBER(7) PK COST NUMBER(7,2) PRODUCT_ID NUMBER(7) Evaluate these two SQL statements: 1.SELECT ROUND(MAX(cost),2), ROUND(MIN(cost),2),ROUND(SUM(cost),2), ROUND(AVG(cost),2) FROM part; 2.SELECT product_id, ROUND(MAX(cost),2), ROUND(MIN(cost),2),ROUND(SUM(cost),2), ROUND(AVG(cost),2) FROM part GROUP BY product_id; How will the results differ? A. Statement 1 will only display one row of results; statement 2 could display more than one. "Pass Any Exam. Any Time." - Guaranteed 82
  • 82. Oracle 1z0-001: Practice Exam B. The results will be the same, but the display will differ. C. Statement 1 will display a result for each part; statement 2 will display a result for each product. D. One of the statements will generate an error. Answer: A QUESTION NO: 150 Which table name is valid? A. invoices-1996 B. catch_#22 C. 1996_invoices D. number E. #_667 Answer: B QUESTION NO: 151 In which section of a PL/SQL block is a user-defined exception raised? A. heading B. declarative C. exception handling D. executable Answer: D QUESTION NO: 152 You need to perform a major update on the EMPLOYEE table. You have decided to disable the PRIMARY KEY constraint on the empid column and the CHECK constraint on the job column. What happens when you try to enable the constraints after the update is completed? A. You need to recreate the constraints once they are disabled. B. The indexes on both the columns with the PRIMARY KEY constraint and the CHECK constraint are automatically re-created. C. Any existing rows that do not confirm with the constraints are automatically deleted. D. All the existing column values are verified to confirm with the constraints and an error message is generated if any existing values do not confirm. "Pass Any Exam. Any Time." - Guaranteed 83
  • 83. Oracle 1z0-001: Practice Exam E. Only the future values are verified to confirm with the constraints, leaving the existing values unchecked. Answer: D QUESTION NO: 153 The structure of the DEPT table is as follows: Name Null? Type ------------------------------- ------------ -------- DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) Examine the declaration section: DECLARE TYPE dept_record_type IS RECORD (dno NUMBER, name VARCHAR2(20)); dept_rec dept_record_type; How do you retrieve an entire row of the DEPT table using the DEPT_REC variable? A. SELECT * INTO dept_rec.dno, dept_rec.name, dept_rec.loc FROM dept WHERE deptno = 10; B. You can not retrieve the entire row using the DEPT_REC variable declared in the code. C. SELECT deptno, dname, loc INTO dept_rec FROM dept WHERE deptno = 10; D. SELECT * INTO dept_rec FROM dept WHERE deptno = 10; Answer: B "Pass Any Exam. Any Time." - Guaranteed 84
  • 84. Oracle 1z0-001: Practice Exam QUESTION NO: 154 You need to update employee salaries. If the salary of an employee is less than 1000, the salary needs to be incremented by 10%. Use a SQL*Plus substitution variable to accept the employee number. Which PL/SQL block successfully updates the salaries? A. DECLARE v_sal emp.sal%TYPE; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = &&p_empno; IF (v_sal < 1000) THEN UPDATE emp INTO sal := sal * 1.1 WHERE empno = &p_empno; END IF; END; B. DECLARE v_sal emp.sal%TYPE; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = &&p_empno; IF (v_sal < 1000) THEN UPDATE emp SET sal = sal * 1.1 WHERE empno = &p_empno; END IF; END; C. DECLARE v_sal emp.sal%TYPE; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = &&p_empno; "Pass Any Exam. Any Time." - Guaranteed 85
  • 85. Oracle 1z0-001: Practice Exam IF (v_sal < 1000) THEN UPDATE emp sal := sal * 1.1 WHERE empno = &p_empno; END IF; END; D. DECLARE v_sal emp.sal%TYPE; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno = &&p_empno; IF (v_sal < 1000) THEN sal := sal * 1.1; END IF; END; Answer: B QUESTION NO: 155 Scott forgot his password while on vacation. What command must be executed to set a password for Scott? A. Scott must execute the command: ALTER USER scott IDENTIFIED BY lion; B. The DBA must execute the command: CHANGE PASSWORD TO lion WHERE USER = 'SCOTT'; C. Scott must execute the command: ALTER USER scott PASSWORD BY lion; D. Scott must execute the command: CHANGE PASSWORD TO lion WHERE USER = 'SCOTT'; E. The DBA must execute the command: ALTER USER scott IDENTIFIED BY lion; "Pass Any Exam. Any Time." - Guaranteed 86
  • 86. Oracle 1z0-001: Practice Exam Answer: E QUESTION NO: 156 You issue this command: CREATE PUBLIC SYNONYM emp FOR ed.employee; Which task has been accomplished? A. All users were given object privileges to the table. B. The need to qualify the object name with its schema has been eliminated for all users. C. The need to qualify the object name with its schema was eliminated for only you. D. The object can now be accessed by all users. Answer: B QUESTION NO: 157 In the declarative section of a PL/SQL block, you created but did not initialize a number variable. When the block executes, what will be the initial value of the variable? A. null B. It depends on the scale and precision of the variable. C. The block will not execute because the variable was not initialized.The block will not execute because the variable was not initialized. D. 0 Answer: A QUESTION NO: 158 Which data dictionary view contains the definition of a view? A. USER_VIEWS B. SYSTEM_VIEWS C. USER_TAB_VIEWS D. MY_VIEWS Answer: A "Pass Any Exam. Any Time." - Guaranteed 87
  • 87. Oracle 1z0-001: Practice Exam QUESTION NO: 159 Which statement is true about nesting blocks? A. Variable names must be unique between blocks. B. A variable defined in the outer block is visible in the inner blocks. C. A variable in an inner block may have the same name as a variable in an outer block only if the data types are different. D. A variable defined in the inner block is visible in the outer blocks. Answer: B QUESTION NO: 160 Examine the structure of the STUDENT table: Name Null? Type ------------- ------------- ------------ STUD_ID NOT NULL NUMBER(3) NAME NOT NULL VARCHAR2(25) ADDRESS VARCHAR2(50) GRADUATION DATE Which statement adds a new column after the NAME column to hold phone numbers? A. ALTER TABLE student ADD COLUMN3 (phone varchar2(9)); B. ALTER TABLE student ADD (phone varchar2(9)) AS COLUMN3; C. You cannot specify the position where a new column has to be added. D. ALTER TABLE student ADD COLUMN phone varchar2(9) POSITION 3; Answer: C QUESTION NO: 161 Evaluate these two SQL commands: 1.SELECT DISTINCT object_type "Pass Any Exam. Any Time." - Guaranteed 88