Questions IZ0 - 007
Questions IZ0 - 007
Questions IZ0 - 007
1. (1Z0-007q13) Which of the following queries can you use to search for employe
es with the pattern 'A_B' in their names?
A. SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\\';
B. SELECT last_name FROM employees WHERE last_name LIKE '%A_B%' ESCAPE ;
C. SELECT last_name FROM employees WHERE last_name LIKE 'A_B%' ESCAPE '%';
D. SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\';
Answer: D
Explanation:
According to the online documentation provided by Oracle:
You can include the actual characters "%" or "_" in the pattern by using the ESC
APE clause, which identifies the escape character.
If the escape character appears in the pattern before the character "%" or "_" t
hen Oracle interprets this character literally in
the pattern, rather than as a special pattern matching character.
To search for employees with the pattern 'A_B' in their name:
SELECT last_name
FROM employees
WHERE last_name LIKE '%A\_B%' ESCAPE '\'
The ESCAPE clause identifies the backslash (\) as the escape character. In the p
attern, the escape character precedes the underscore
(_). This causes Oracle to interpret the underscore literally, rather than as a
special pattern matching character.
2. (1Z0-007q20) Refer to the SQL codes below:
SELECT manager_id, last_name, hire_date, salary,
AVG(salary) OVER (PARTITION BY manager_id ORDER BY hire_date
ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS c_mavg
FROM employees;
What has been achieved?
A. because of a syntax problem, no row will be returned
B. it calculates, for each employee in the employees table, the average salary o
f the employees reporting to his/her respective manager
C. it calculates, for each employee in the employees table, the average salary o
f the employees reporting to his/her respective manager who were hired just befo
re the employee
D. it calculates, for each employee in the employees table, the average salary o
f the employees reporting to the same manager who were hired in the range just b
efore through just after the employee
E. it calculates, for each employee in the employees table, the average salary o
f the employees reporting to his/her respective manager who were hired just afte
r the employee
Answer: D
Explanation:
According to the online documentation provided by Oracle:
AVG returns average value of expr. You can use it as an aggregate or analytic fu
nction.
If you specify DISTINCT, you can specify only the query_partition_clause of the
analytic_clause. The order_by_clause and windowing_clause are not allowed.
3. (1Z0-007q24) With 9i SQL Plus, what kind of commands can you enter at the com
mand prompt (Choose all that apply)?
A. PL/SQL blocks
B. SQL*Plus commands
C. security commands
D. SQL commands
Answer: ABD
Explanation:
According to the online documentation provided by Oracle:
You can enter three kinds of commands at the command prompt:
* SQL commands, for working with information in the database
* PL/SQL blocks, also for working with information in the database
* SQL*Plus commands, for formatting query results, setting options, and editing
and storing SQL commands and PL/SQL blocks
6. (1Z0-007q124) To write a query that performs an outer join of tables A and B
and returns all rows from B, you need to write
A. any outer join
B. a left outer join
C. a cross join
D. a right outer join
E. an inner join
Answer: D
Explanation:
According to the technical documentation at http://download-west.oracle.com:
To write a query that performs an outer join of tables A and B and returns all r
ows from B (a right outer join), use the ANSI RIGHT [OUTER] syntax, or apply the
outer join operator (+) to all columns of A in the join condition. For all rows
in B that have no matching rows in A, Oracle returns null for any select list e
xpressions containing columns of A.
8. (1Z0-007q51) Which of the following is true if you use the alter tablespace s
tatement and specify the TEMPORARY clause (Choose all that apply)?
A. Oracle no longer perform any checkpoint for the online datafiles in the table
space
B. Oracle performs a checkpoint for all online datafiles in the tablespace
C. Oracle does not ensure that all files are written
D. The offline files may require media recovery before you bring the tablespace
online
E. The offline files may require media recovery after you bring the tablespace o
nline
Answer: BCD
Explanation:
According to the technical documentation at http://download-west.oracle.com:
If you specify TEMPORARY, Oracle performs a checkpoint for all online datafiles
in the tablespace but does not ensure that all files can be written. Any offline
files may require media recovery before you bring the tablespace back online.
9. (1Z0-007q195) Which of the following correctly shows the correct use of the T
RUNC command on a date?
A. SELECT TRUNC(TO_DATE(12-Feb-99,DD-MON-YY, 'YEAR')) "Date " FROM DUAL;
B. TRUNC = TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR', "Date " FROM DUAL;
C. SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL;
D. date = TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL
Answer: C
Explanation:
According to the technical documentation at http://download-west.oracle.com:
TRUNC returns date with the time portion of the day truncated to the unit specif
ied by the format model fmt. If you omit fmt, date is truncated to the nearest d
ay.
10. (1Z0-007q166) To grant a system privilege with the GRANT statement, you must
(Choose all that apply)?
A. have been granted the GRANT ROLE PRIVILEGE system privilege
B. have been granted the system privilege with the ADMIN OPTION
C. have been granted the GRANT ANY PRIVILEGE system privilege
D. have been granted the system privilege with the GRANT OPTION
Answer: BC
Explanation:
According to the technical documentation at http://download-west.oracle.com:
To grant a system privilege, you must either have been granted the system privil
ege with the ADMIN OPTION or have been granted the GRANT ANY PRIVILEGE system pr
ivilege.
11. (1Z0-007q44) Which of the following are the conditions that must b met befor
e you can use RENAME DATAFILE with the alter tablepace command (Choose all that
apply)?
A. the database must be taken offline before renaming
B. the database must be open
C. when only a single datafile is to be renamed
D. when only a single datafile on the same drive is to be renamed
Answer: AB
Explanation:
According to the technical documentation at http://download-west.oracle.com: Spe
cify RENAME DATAFILE to rename one or more of the tablespace's datafiles. The da
tabase must be open, and you must take the tablespace offline before renaming it
. Each 'filename' must fully specify a datafile using the conventions for filena
mes on your operating system.
This clause merely associates the tablespace with the new file rather than the o
ld one. This clause does not actually change the name of the operating system fi
le. You must change the name of the file through your operating system.
12. (1Z0-007q42) Before making a tablespace read only, which of the following co
nditions must be met (Choose all that apply)?
A. The tablespace must contain an active rollback segments.
B. The tablespace must be online.
C. The tablespace must not contain any active rollback segments.
D. The tablespace must not be involved in an open backup.
E. The tablespace must be involved in an open backup.
Answer: BCD
Explanation:
According to the technical documentation at http://download-west.oracle.com:
Before you can make a tablespace read only, the following conditions must be met
:
* The tablespace must be online.
* The tablespace must not contain any active rollback segments. For this reason,
the SYSTEM tablespace can never be made read only, because it contains the SYST
EM rollback segment. Additionally, because the rollback segments of a read-only
tablespace are not accessible, Oracle recommends that you drop the rollback segm
ents before you make a tablespace read only.
* The tablespace must not be involved in an open backup, because the end of a ba
ckup updates the header file of all datafiles in the tablespace.
--------------------------------------------------------------------------------
--------------------------------------------------
13. (1Z0-007q41) The MANAGE TABLESPACE system privilege allows you to perform wh
ich of the following operations (Choose all that apply)?
A.
Take the tablespace offline
B. Begin a backup
C. End a backup
D. Take the tablespace online
E. Make the tablespace read only
F. Make the tablespace read write
Answer: ABCDEF
Explanation:
According to the technical documentation at http://download-west.oracle.com:
If you have MANAGE TABLESPACE system privilege, you can only perform the followi
ng operations:
* Take the tablespace online or offline
* Begin or end a backup
* Make the tablespace read only or read write
18. (1Z0-007q9) Which of the following has been achieved by the following SQL co
des?
SELECT employee_id FROM employees
WHERE commission_pct = .5 OR salary > 23000;
A. it returns employees who have a 50% of a salary greater than $23,000:
B. it returns employees who have a 50% commission rate or a salary greater than
$23,000:
C. runtime error
D. it returns employees who have a 50% of a salary less than $23,000:
E. invalid syntax
F. it returns employees who have a 50% commission rate and a salary greater than
$23,000:
Answer: B
19. (1Z0-007q8) Which of the following has been achieved by the following SQL co
des?
SELECT * FROM employees
WHERE hire_date < TO_DATE ('01-JAN-1999', 'DD-MON-YYYY')
AND salary > 3500;
A. only those hired before 1999 and earning less than $3500 a month are returned
B. compile time error
C. only those hired after 1999 and earning more than $3500 a month are returned
D. runtime error
E. only those hired before 1999 and earning more than $3500 a month are returned
Answer: E
20. (1Z0-007q19) Which of the following SQL statements can calculate and return
the absolute value of -33?
A. SELECT ABS("-33") Absolute FROM DUAL;
B. SELECT ABS('-33') "Absolute" FROM DUAL;
C. SELECT ABS(-33) "Absolute" FROM DUAL;
D. SELECT ABS(-33), Absolute FROM DUAL;
Answer: C
Explanation:
Purpose
ABS returns the absolute value of n.
The following example returns the absolute value of -15:
SELECT ABS(-15) "Absolute" FROM DUAL;
Which two SQL statements produce the ;name, department name, and the city of all
the employees who earn more than 10000? (Choose Two).
A. SELECT emp_name, department_name, city FROM employees e
JOIN departments d USING (department_id) JOIN locations 1
USING (location_id) WHERE salary > 10000;
B. SELECT emp_name, department_name, city FROM employees e, departments d,
locations 1 JOIN ON (e. department_id = d. department id)
AND (d.location_id = 1.location_id) AND salary > 10000;
C. SELECT emp_name, department_name, city
FROM employees e, departments d, locations 1 WHERE salary > 1000;
D. SELECT emp_name, department_name, city FROM employees e, departments d,
locations 1 WHERE e.department_id = d.department_id AND d.location_id = 1.loc
ation_id AND salary > 10000;
E. SELECT emp_name, department_name, city FROM employees e
NATURAL JOIN departments, locations WHERE salary > 10000;
Answer: AD
14 .Which SQL statement would you use to remove a view called EMP_DEPT_VU from y
our schema?
A. DROP emp_dept_vu;
B. DELETE emp_dept_vu;
C. REMOVE emp_dept_vu;
D. DROP VIEW emp_dept_vu;
E. DELETE VIEW emp_dept_vu;
F. REMOVE VIEW emp_dept_vu;
Answer: D
15 .Which is an iSQL*Plus command?
A. INSERT
B. UPDATE
C. SELECT
D. DESCRIBE
E. DELETE
F. RENAME
Answer: D
16 .The EMPLOYEES table has these columns:
LAST_NAME VARCHAR2(35)
SALARY NUMBER(8,2)
HIRE_DATE DATE
Management wants to add a default value to the SALARY column. You plan to alter
the table by using this SQL statement:
ALTER TABLE EMPLOYEES MODIFY (SALARY DEFAULT 5000);
Which is true about your ALTER statement?
A. Column definitions cannot be altered to add DEFAULT values.
B. A change to the DEFAULT value affects only subsequent insertions to the table
.
C. Column definitions cannot be altered to add DEFAULT values for columns with a
NUMBER data type.
D. All the rows that have a NULL value for the SALARY column will be updated wit
h the value 5000.
Answer: B
Explanation:
A change to the DEFAULT value affects only subsequent insertions to the table. E
xisting
rows will not be affected.
Incorrect Answers
A: Column definitions can be altered to add DEFAULT values.
C: Column definitions can be altered to add DEFAULT values. It works for columns
with a
NUMBER data type also.
D: A change to the DEFAULT value affects only subsequent insertions to the table
. Existing
rows will not be affected.
OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 219-224
Chapter 5: Creating Oracle Database Objects
Question: 1. (A)
Which SELECT statement should you use if you want to display unique combinations
of the
POSITION and MANAGER values from the EMPLOYEE table?
A. SELECT DISTINCT position, manager
FROM employee;
B. SELECT position, manager DISTINCT FROM employee;
C. SELECT position, manager
FROM employee;
D. SELECT position, DISTINCT manager
FROM employee;
Answer: A Explanation:
To display a unique values in the result you can use the DISTINCT key word this
will eliminate the duplicate values from the result of the query.
Question: 2. (A)
Which two are attributes of iSQL*Plus? (Choose two)
A. iSQL*Plus commands cannot be abbreviated.
B. iSQL*Plus commands are accesses from a browser.
C. iSQL*Plus commands are used to manipulate data in tables.
D. iSQL*Plus commands manipulate table definitions in the database.
E. iSQL*Plus is the Oracle proprietary interface for executing SQL statements.
Answer: B, E Question: 3. (A)
You need to perform certain data manipulation operations through a view called E
MP_DEPT_VU, which you previously created.
You want to look at the definition of the view (the SELECT statement on which th
e view was
create.)
How do you obtain the definition of the view?
A. Use the DESCRIBE command in the EMP_DEPT VU view.
B. Use the DEFINE VIEW command on the EMP_DEPT VU view.
C. Use the DESCRIBE VIEW command on the EMP_DEPT VU view.
D. Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.
E. Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view
.
F. Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU vie
w.
Answer: D Explanation:
To look on the view definition you need to query the USER_VIEWS data dictionary
view and search for the EMP_DEPT_VU view.
Incorrect Answers
A: You cannot see the definition of the view using the DESCRIBE command.
B: There is no DEFINE VIEW command in Oracle.
C: There is no DESCRIBE VIEW command in Oracle.
TK
Exam Name: Introduction to Oracle9i: SQL
Exam Type: Oracle Exam Code: 1Z0-007
Doc. Type: Q & A with explanations Total Questions 301
E: You cannot use the USER_SOURCE data dictionary view to see the definition of
your view: it
is used to store system objects definitions only.
F: You can find record about view in the USER_OBJECTS, but it does not contain t
he definition
of the view itself.
OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 291-301
Chapter 7: Creating Other Database Objects in Oracle
Question: 4. (A)
Which is an /SQL*Plus command?
A. INSERT B. UPDATE C. SELECT
D. DESCRIBE E. DELETE
F. RENAME
Answer: D Explanation:
There is only one SQL*Plus command in this list: DESCRIBE. It cannot be used as
SQL
command. This command returns a description of tablename, including all columns
in that table, the datatype for each column, and an indication of whether the co
lumn permits storage of NULL values.
Incorrect Answers
A: INSERT is not a SQL*Plus command. ItQuestion: 1. (A)
Which SELECT statement should you use if you want to display unique combinations
of the
POSITION and MANAGER values from the EMPLOYEE table?
A. SELECT DISTINCT position, manager
FROM employee;
B. SELECT position, manager DISTINCT FROM employee;
C. SELECT position, manager
FROM employee;
D. SELECT position, DISTINCT manager
FROM employee;
Answer: A Explanation:
To display a unique values in the result you can use the DISTINCT key word this
will eliminate the duplicate values from the result of the query.
Question: 2. (A)
Which two are attributes of iSQL*Plus? (Choose two)
A. iSQL*Plus commands cannot be abbreviated.
B. iSQL*Plus commands are accesses from a browser.
C. iSQL*Plus commands are used to manipulate data in tables.
D. iSQL*Plus commands manipulate table definitions in the database.
E. iSQL*Plus is the Oracle proprietary interface for executing SQL statements.
Answer: B, E Question: 3. (A)
You need to perform certain data manipulation operations through a view called E
MP_DEPT_VU, which you previously created.
You want to look at the definition of the view (the SELECT statement on which th
e view was
create.)
How do you obtain the definition of the view?
A. Use the DESCRIBE command in the EMP_DEPT VU view.
B. Use the DEFINE VIEW command on the EMP_DEPT VU view.
C. Use the DESCRIBE VIEW command on the EMP_DEPT VU view.
D. Query the USER_VIEWS data dictionary view to search for the EMP_DEPT_VU view.
E. Query the USER_SOURCE data dictionary view to search for the EMP_DEPT_VU view
.
F. Query the USER_OBJECTS data dictionary view to search for the EMP_DEPT_VU vie
w.
Answer: D Explanation:
To look on the view definition you need to query the USER_VIEWS data dictionary
view and search for the EMP_DEPT_VU view.
Incorrect Answers
A: You cannot see the definition of the view using the DESCRIBE command.
B: There is no DEFINE VIEW command in Oracle.
C: There is no DESCRIBE VIEW command in Oracle.
TK
Exam Name: Introduction to Oracle9i: SQL
Exam Type: Oracle Exam Code: 1Z0-007
Doc. Type: Q & A with explanations Total Questions 301
E: You cannot use the USER_SOURCE data dictionary view to see the definition of
your view: it
is used to store system objects definitions only.
F: You can find record about view in the USER_OBJECTS, but it does not contain t
he definition
of the view itself.
OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 291-301
Chapter 7: Creating Other Database Objects in Oracle
Question: 4. (A)
Which is an /SQL*Plus command?
A. INSERT B. UPDATE C. SELECT
D. DESCRIBE E. DELETE
F. RENAME
Answer: D Explanation:
There is only one SQL*Plus command in this list: DESCRIBE. It cannot be used as
SQL
command. This command returns a description of tablename, including all columns
in that table, the datatype for each column, and an indication of whether the co
lumn permits storage of NULL values.
Incorrect Answers
A: INSERT is not a SQL*Plus command. It
1. What does the FORCE option for creating a view do?
A.creates a view with constraints
B.creates a view even if the underlying parent table has constraints
C.creates a view in another schema even if you don t have privileges
D.creates a view regardless of whether or not the base tables exist
Answer: D
2. What are two reasons to create synonyms? (Choose two.)
A.You have too many tables.
B.Your tables are too long.
C.Your tables have difficult names.
D.You want to work on your own tables.
E.You want to use another schema s tables.
F.You have too many columns in your tables.
Answer: CE
Free Pass4sure p4s Practice Engine Demo Download PassGuide offers free demos for
each certification exam, including all IT vendors. You can check out the testin
g engine software, or pdf file question quality and usability of our practice ex
ams before you decide to buy it. We are the only one site that offers demos for
almost all IT certification exams.If you want to try passguide exam practice eng
ine
3. The STUDENT_GRADES table has these columns:
STUDENT_ID NUMBER(12)
SEMESTER_END DATE
GPA NUMBER(4,3)
The registrar requested a report listing the students grade point averages (GPA)
sorted from highest grade point
average to lowest.
Which statement produces a report that displays the student ID and GPA in the so
rted order requested by the
registrar?
A.SELECT student_id, gpa
FROM student_grades
ORDER BY gpa ASC;
B.SELECT student_id, gpa
FROM student_grades
SORT ORDER BY gpa ASC;
C.SELECT student_id, gpa
FROM student_grades
SORT ORDER BY gpa;
D.SELECT student_id, gpa
FROM student_grades
ORDER BY gpa;
E.SELECT student_id, gpa
FROM student_grades
SORT ORDER BY gpa DESC;
F.SELECT student_id, gpa
FROM student_grades
ORDER BY gpa DESC;
Answer: F
4. In which three cases would you use the USING clause? (Choose three.)
A.You want to create a nonequijoin.
B.The tables to be joined have multiple NULL columns.
C.The tables to be joined have columns of the same name and different data types
.
D.The tables to be joined have columns with the same name and compatible data ty
pes.
E.You want to use a NATURAL join, but you want to restrict the number of columns
in the join condition.
Answer: CDE
5. The CUSTOMERS table has these columns:
CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
STREET_ADDRESS VARCHAR2(150)
CITY_ADDRESS VARCHAR2(50)
STATE_ADDRESS VARCHAR2(50)
PROVINCE_ADDRESS VARCHAR2(50)
COUNTRY_ADDRESS VARCHAR2(50)
POSTAL_CODE VARCHAR2(12)
CUSTOMER_PHONE VARCHAR2(20)
The CUSTOMER_ID column is the primary key for the table.
You need to determine how dispersed your customer base is. Which expression find
s the number of different
countries represented in the CUSTOMERS table?
A.COUNT(UPPER(country_address))
B.COUNT(DIFF(UPPER(country_address)))
C.COUNT(UNIQUE(UPPER(country_address)))
D.COUNT DISTINCT UPPER(country_address)
E.COUNT(DISTINCT (UPPER(country_address)))
Answer: E