Академический Документы
Профессиональный Документы
Культура Документы
QUESTION NO: 1
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:
Answer: B
QUESTION NO: 2
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
Answer: B
QUESTION NO: 4
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
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?
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
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.
Answer: C
QUESTION NO: 10
Answer: B
QUESTION NO: 11
What would happen if you removed all the parentheses from the calculation?
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?
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
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;
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
BEGIN
FOR employee_record IN salary_cursor LOOP
employee_id_table(employee_id) :=
employee_record.last_name;
END LOOP;
CLOSE salary_cursor;
END;
Answer: A
QUESTION NO: 17
DECLARE
v_result NUMBER(2);
BEGIN
DELETE
FROM employee
WHERE dept_id IN (10, 20, 30);
v_result := SQL%ROWCOUNT;
COMMIT;
END;
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?
Answer: D
QUESTION NO: 20
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?
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.
Answer: B
QUESTION NO: 23
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
Answer: E
QUESTION NO: 26
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.
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
GRADUATION
--------------
20-JAN-1999
12-MAY-1999
19-JAN-2000
25-MAY-2000
13-JAN-2001
29-MAY-2001
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
Answer: E
QUESTION NO: 30
You need to display the names of employees that earn more than the average salary of all
employees.
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
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
Answer: A
QUESTION NO: 34
FIRST_NAME VARCHAR2(25)
"Pass Any Exam. Any Time." - Guaranteed 18
Oracle 1z0-001: Practice Exam
LAST_NAME VARCHAR2(25)
Answer: A
QUESTION NO: 35
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
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
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
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%.
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
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
There are 100 records in the STUDENT table. You need to modify the PHONE column to hold
only numeric values.
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?
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
Answer: B
QUESTION NO: 44
Click on the EXHIBIT button and examine the table instance chart for the employee table.
10 of October 1999.
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
There are 100 records in the STUDENT table. You want to change the name of the
GRADUATION column to GRAD_DATE.
Answer: A
QUESTION NO: 47
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:
Answer: A
QUESTION NO: 48
Click on the EXHIBIT button and examine the structure of the BOOK_TITLE, COPY, and
CHECK_OUT tables.
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
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
Answer: C
QUESTION NO: 50
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.
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.
Answer: D
QUESTION NO: 52
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.)
Answer: B,D
QUESTION NO: 55
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?
Answer: A
QUESTION NO: 56
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%.
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?
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?
Answer: D
QUESTION NO: 59
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
A. 500
B. 750
C. 250
D. 1000
E. 1250
QUESTION NO: 61
A. 3
B. 1
C. 0
D. 2
Answer: B
QUESTION NO: 62
A. DESCRIBE
B. CHANGE
C. LIST
D. UPDATE
E. ACCEPT
Answer: D
QUESTION NO: 63
Answer: D
QUESTION NO: 64
QUESTION NO: 65
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
A. 2
B. 3
C. 0
D. 1
Answer: D
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
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?
Answer: C
QUESTION NO: 70
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;
A. 4
B. 8
C. 0
D. 10
E. 6
Answer: B
QUESTION NO: 71
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
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.
Answer: B
QUESTION NO: 73
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
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?
Answer: A
QUESTION NO: 76
Click on the EXHIBIT button and examine the table instance chart for the cars table.
Answer: A
QUESTION NO: 77
Answer: A
QUESTION NO: 78
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?
Answer: D
QUESTION NO: 81
Which change should you make to the script so that it will execute?
Answer: D
QUESTION NO: 82
Which ALTER command would you use to reinstate a disabled primary key constraint?
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?
Answer: D
QUESTION NO: 84
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
You received an integrity constraint error because a child record was found. What could you do to
make the statement execute?
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?
QUESTION NO: 87
Answer: D
QUESTION NO: 88
Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE
tables.
Answer: B
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?
Answer: A
QUESTION NO: 91
GRADUATION
--------------
20-JAN-1999
12-MAY-1999
19-JAN-2000
25-MAY-2000
13-JAN-2001
29-MAY-2001
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';
QUESTION NO: 92
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
Answer: B
QUESTION NO: 93
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
A. heading
B. declarative
C. executable
D. exception handling
Answer: C
QUESTION NO: 95
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?
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?
Answer: A
QUESTION NO: 98
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.
Answer: A
QUESTION NO: 99
Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE
tables.
Answer: A
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
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?
Answer: C
Answer: C
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
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?
Answer: B
A. Southall
B. none
C. Chiazza
D. Brown
Answer: C
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:
Answer: D
Answer: D
DECLARE
v_result NUMBER(2);
BEGIN
DELETE
FROM employee
WHERE dept_id IN (10, 20, 30);
v_result := SQL%ROWCOUNT;
COMMIT;
END;
Answer: A
Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)
Answer: C,D
DECLARE
dept_rec dept%ROWTYPE;
BEGIN
SELECT *
INTO dept_rec
FROM dept
WHERE deptno = 10;
END;
Answer: A
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
A. START QUERYEMP
B. RUN QUERYEMP
C. GET QUERYEMP
D. EXECUTE QUERYEMP
Answer: A
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,
Answer: B
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.)
Answer: A
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;
A. 8
B. 10
C. 4
D. 6
E. 0
Answer: A
Answer: D
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?
Answer: B
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
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.
Answer: D
BONUSNUMBER(7,2)
There are 10 departments and each department has at least 1 employee. Bonus values are
greater than 500; not all employees receive a bonus.
Answer: C
UPDATE emp_view
SET tot_sal = 20000
WHERE deptno = 10;
Answer: A
Answer: C
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?
Answer: D
Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.
SELECT pr.name
FROMpart pt, product pr
WHEREpt.product_id(+) = pr.id;
Answer: C
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
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
Answer: B
You want to create a report that gives, per department, the number of employees and total salary
as a percentage of all the departments.
Answer: B
A. INDEX
B. DROP ANY TABLE
C. DELETE
D. UPDATE
E. ALTER
Answer: B
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
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.
Answer: D
For which three tasks would you use the WHERE clause? (Choose three.)
Answer: A,B,F
You have a view called ANN_SAL that is based on the EMPLOYEE table. The structure of the
ANN_SAL view is:
A. SELECT *
FROM VIEW ann_sal BASEDON employee;
B. SELECT *
FROM EMPLOYEE;
C. SELECT *
FROM ann_sal;
D. SELECT *
FROM VIEW ann_sal;
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:
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
Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.
SELECT pr.name
FROMpart pt, product pr
WHEREpt.product_id(+) = pr.id;
Answer: B
Answer: B
Answer: D
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
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?
Answer: B
Answer: D
Answer: A
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
Answer: A
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
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
DECLARE
TYPE dept_record_type IS RECORD
(dno NUMBER,
name VARCHAR2(20));
dept_rec dept_record_type;
BEGIN
SELECT deptno, dname
INTO dept_rec
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
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.
Answer: C
SELECT employee.ename
FROM emp employee
WHERE employee.empno NOT IN
(SELECT manager.mgr
FROM emp manager);
A. ALL
B. !=ALL
C. NOT LIKE
D. !=
Answer: B
ID NUMBER(7) PK
COST NUMBER(7,2)
PRODUCT_ID NUMBER(7)
1.SELECT ROUND(MAX(cost),2),
ROUND(MIN(cost),2),ROUND(SUM(cost),2),
ROUND(AVG(cost),2)
FROM part;
A. Statement 1 will only display one row of results; statement 2 could display more than one.
Answer: A
A. invoices-1996
B. catch_#22
C. 1996_invoices
D. number
E. #_667
Answer: B
A. heading
B. declarative
C. exception handling
D. executable
Answer: D
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?
Answer: D
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
You need to update employee salaries. If the salary of an employee is less than 1000, the salary
needs to be incremented by 10%.
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
Scott forgot his password while on vacation. What command must be executed to set a password
for Scott?
Answer: B
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
A. USER_VIEWS
B. SYSTEM_VIEWS
C. USER_TAB_VIEWS
D. MY_VIEWS
Answer: A
Answer: B
Which statement adds a new column after the NAME column to hold phone numbers?
Answer: C
A. 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.
B. Statement 1 will display the distinct object types in the database; statement 2 will display all the
object types in the database.
C. Statement 1 will display the distinct object types owned by the user; statement 2 will display all
the object types in the database.
D. Statement 1 will display the distinct object types owned by the user; statement 2 will display all
the object types the user can access.
Answer: D
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. DELETE *
FROM student;
C. TRUNCATE TABLE student;
D. TRUNCATE TABLE student
KEEP STRUCTURE;
E. DROP TABLE student;
Answer: C
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
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.
Answer: A
A. 250
B. 500
C. 1250
D. 750
E. 1000
Answer: B
SET SERVEROUTPUT ON
DECLARE
v_name emp.ename%TYPE;
v_num NUMBER;
v_sal NUMBER(8,2);
BEGIN
-- This code displays salaries if larger than 10000
SELECT ename, sal
"Pass Any Exam. Any Time." - Guaranteed 90
Oracle 1z0-001: Practice Exam
INTO v_name, v_sal
FROM emp
WHERE empno = 101;
IF (v_sal .GT. 10000) THEN
DBMS_OUTPUT.PUT_LINE ('Salary is ' || v_sal
|| ' for employee ' || v_name);
END IF;
END;
SET SERVEROUTPUT OFF
Which statement causes a compilation error when the above PL/SQL block is executed?
Answer: B
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?
You need to display the names of employees that earn more than the average salary of all
employees.
A. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
B. Move the function to the SELECT clause and add a GROUP BY clause.
C. Use a subquery in the WHERE clause to compare the average salary value.
D. Change the function in the WHERE clause.
Answer: C
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. ALL_OBJECTS
B. DBA_TABLES
C. USER_OBJECTS
D. DBA_SEGMENTS
Answer: A
A. Jane can access the table, but she cannot see your changes and cannot make the same
changes.
B. Jane can access the table, but she cannot see your changes. She can make the changes for
you.
C. Jane can access the table and verify your changes.
D. Jane cannot access the table.
Answer: A
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)
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);
END;
D. DECLARE
v_hiredate DATE := SYSDATE;
BEGIN
Answer: C
Click on the EXHIBIT button and examine the table instance chart for the patient table.
Which script would you use to delete a patient from the table by prompting the user for the
id_number of the patient?
A. DELETE
FROM patient
WHERE id_number = :id_number
/
B. DELETE
FROM patient
WHERE id_number = &id_number
/
C. DEFINE :id_number
DELETE
FROM patient
WHERE id_number = :id_number
/
D. This task cannot be accomplished.
E. DELETE
DEFINE &id_number
FROM patient
WHERE id_number = &id_number
"Pass Any Exam. Any Time." - Guaranteed 94
Oracle 1z0-001: Practice Exam
/
Answer: B