Beruflich Dokumente
Kultur Dokumente
Version 1.0
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.
FROMplayer p, player m
WHEREm.id = p.manager_id;
FROMplayer p, player m
WHEREm.manager_id = p.id;
B. The results will be the same, but the display will be different.
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
Answer: A
QUESTION NO: 3
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.
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.
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.
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?
A. SELECT lastname, firstname
FROM emp
FROM emp
FROM emp
FROM emp
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 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.
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
C. The results are sorted by the first column in the SELECT list if the ORDER BY clause is not provided.
E. You cannot sort query results by a column that is not included the SELECT list.
Answer: B
QUESTION NO: 11
FROMemployee e, sale s
WHEREe.id = s.emp_id;
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?
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?
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
QUESTION NO: 14
DECLARE
CURSOR emp_cursor IS
FROM emp;
emp_rec emp_cursor%ROWTYPE;
BEGIN
OPEN emp_cursor;
LOOP
FETCH emp_cursor
INTO emp_rec;
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
FROM emp;
BEGIN
END LOOP;
CLOSE emp_cursor;
END;
B. DECLARE
CURSOR emp_cursor IS
FROM emp;
BEGIN
END LOOP;
END;
C. DECLARE
CURSOR emp_cursor IS
emp_rec emp_cursor%ROWTYPE;
BEGIN
FETCH emp_cursor
INTO emp_rec;
END LOOP;
END;
D. DECLARE
CURSOR emp_cursor IS
FROM emp;
BEGIN
OPEN emp_cursor;
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?
C. %ROWTYPE variable
D. PL/SQL record
Answer: B
QUESTION NO: 16
BEGIN
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
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
FROM emp m
B. SELECT e.ename
FROM emp e
C. SELECT e.ename
FROM emp e
D. SELECT e.ename
FROM emp e
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?
TO smith;
TO smith;
TO smith;
TO smith;
Answer: D
QUESTION NO: 20
v_new_value := 2 * v_value;
ELSIF v_value > 200 THEN
v_new_value := 3 * v_value;
v_new_value := 4 * v_value;
ELSE
v_new_value := 5 * v_value;
END IF;
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.
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.
SELECT employee.ename
(SELECT manager.mgr
Answer: B
QUESTION NO: 23
ADDRESS VARCHAR2(50)
GRADUATION DATE
VALUES (101,'Smith');
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
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
C. ALL_SOURCE
D. TABLE_PRIVILEGES
E. ALL_COL_PRIVS_RECD
F. ALL_OBJECTS
Answer: E
QUESTION NO: 26
EMP Table
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
TAX Table
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
B. DECLARE
INDEX BY BINARY_INTEGER;
emp_table emp_table_type;
C. BEGIN
emp_table emp_table_type;
D. DECLARE
INDEX BY WHOLE_NUMBER;
emp_table emp_table_type;
Answer: B
QUESTION NO: 28
ADDRESS VARCHAR2(50)
GRADUATION DATE
GRADUATION
--------------
20-JAN-1999
12-MAY-1999
19-JAN-2000
25-MAY-2000
13-JAN-2001
29-MAY-2001
A. UPDATE student
graduation = '15-AUG-2000'
C. UPDATE student
graduation = '29-MAY-2001'
D. UPDATE student
graduation = '29-MAY-2001'
Answer: A
QUESTION NO: 29
FIRST_NAMEVARCHAR2(25)
COMMISSION NUMBER(3,2)
FROM employee
WHERE commission =
(SELECTcommission
FROMemployee
WHEREUPPER(first_name) = 'SCOTT')
E. There is more than one employee with the first name Scott.
Answer: E
QUESTION NO: 30
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.
FROMemployee
A. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING 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
C. Use the ALTER USER command to assign the user a default tablespace.
Answer: A
QUESTION NO: 34
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
LENGTH(CONCAT(first_name, last_name))
FROM employee
LENGTH(last_name) + LENGTH(first_name)
FROM employee
WHERE INITCAP(SUBSTR(last_name, 1, 1)) IN ('J', 'K', 'L');
D. The statements will retrieve the same data from the database, but will display it differently.
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
You query the database with this command:
FROM employee
WHERE salary IN
(SELECT salary
FROM employee
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
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.
Answer: B
QUESTION NO: 38
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%.
FROMproduct;
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
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.
Answer: B
QUESTION NO: 41
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.
C. You cannot modify the datatype of a column if there is data in the 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?
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 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?
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-44','DD-MON-YY'),
TO_DATE('10-JUN-04','DD-MON-YY'));
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-1944','DD-MON-YYYY'),
TO_DATE('10-JUN-04','DD-MON-RR'));
VALUES (EMPNO_SEQ.NEXTVAL,'SMITH',
TO_DATE('12-DEC-44','DD-MON-RR'),
TO_DATE('10-JUN-04','DD-MON-RR'));
'10-JUN-04');
Answer: B
QUESTION NO: 44
Click on the EXHIBIT button and examine the table instance chart for the employee table.
10 of October 1999.
FROM employee;
FROM employee;
FROM employee;
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;
D. DELETE *
FROM student;
Answer: E
QUESTION NO: 46
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.
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
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.
FROM employee
WHEREdept_id = NULL;
Answer: A
QUESTION NO: 48
Click on the EXHIBIT button and examine the structure of the BOOK_TITLE, COPY, and CHECK_OUT
tables.
AS
FROMbook_title b, copy c
WHEREb.id = c.title_id
ORDER BY b.author;
What does the statement provide?
A. a syntax error
Answer: A
QUESTION NO: 49
SET SERVEROUTPUT ON
DECLARE
x NUMBER;
v_sal NUMBER;
BEGIN
x := 1;
v_sal := 1000;
DECLARE
v_found VARCHAR2(10);
y NUMBER;
BEGIN
v_found := 'YES';
END IF;
y := 20;
END;
END;
Value of Y is 20
Value of Y is 20
Answer: C
QUESTION NO: 50
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
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.
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.
MAXVALUE 999999999
STEP BY 1;
ON patient (patient_id)
MINVALUE 1000
MAXVALUE 999999999
INCREMENT BY 1
NOCYCLE;
MAXVALUE 999999999
NOCYCLE;
Answer: D
QUESTION NO: 52
FROM employee
WHERE salary =
(SELECT salary
FROM employee
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
C. SELECT view_text
FROM my_views
D. DESCRIBE emp
E. SELECT view_text
Answer: A
QUESTION NO: 54
Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)
C. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.
Answer: B,D
QUESTION NO: 55
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?
Answer: A
QUESTION NO: 56
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%.
FROM product;
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.
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?
FROM ord;
FROM ord;
FROM ord;
"Time Taken"
FROM ord;
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.
Answer: A
QUESTION NO: 60
v_new_value := 2 * v_value;
v_new_value := 3 * v_value;
v_new_value := 4 * v_value;
ELSE
v_new_value := 5 * v_value;
END IF;
A. 500
B. 750
C. 250
D. 1000
E. 1250
Answer: A
QUESTION NO: 61
/
How many roles will user SCOTT have access to?
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
FROM employee
GROUP BY dept_no
Answer: D
QUESTION NO: 64
ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
COMMISSION NUMBER(7,2)
FROM employee
WHEREcommission <> 0;
B. a syntax error
Answer: D
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
B. 3
C. 0
D. 1
Answer: D
QUESTION NO: 67
BEGIN
IF i = 1 THEN null;
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
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?
Answer: C
QUESTION NO: 70
Evaluate this PL/SQL block:
BEGIN
IF i = 4 OR i = 6 THEN
null;
ELSE
VALUES (I);
END IF;
COMMIT;
END LOOP;
ROLLBACK;
END;
A. 4
B. 8
C. 0
D. 10
E. 6
Answer: B
QUESTION NO: 71
2.(employee_idNUMBER(9)
4.1995_salaryNUMBER(8,2),
5.manager_nameVARCHAR2(25)
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.
C. You eliminate the need to grant SELECT privileges on the table used in the FROM clause subquery.
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'
B. UPDATE emp
C. UPDATE emp
D. UPDATE emp
Answer: D
QUESTION NO: 75
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?
Answer: A
QUESTION NO: 76
Click on the EXHIBIT button and examine the table instance chart for the cars table.
FROM cars
GROUP BY lot_no
C. GROUP BY lot_no
D. ORDER BY COUNT(*)
Answer: A
QUESTION NO: 77
B. INDEX
C. DELETE
D. UPDATE
E. ALTER
Answer: A
QUESTION NO: 78
FROM emp
BEGIN
IF n1 > n2 THEN
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?
SELECT constraint_name
FROM user_constraints
FROM user_cons_columns
FROM user_constraints
SELECT constraint_name
FROM user_constraints
Answer: D
QUESTION NO: 81
ID NUMBER(9) PK
LAST_NAME VARCHAR2(25)NN
DEPT_ID NUMBER(9)
SELECT *
FROMemployee
WHEREid = (&id_2)
Which change should you make to the script so that it will execute?
D. No change is needed.
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?
FROM EMP
FROM EMP
FROM EMP
FROM EMP
FROM EMP
Answer: D
QUESTION NO: 84
FIRST_NAMEVARCHAR2(25)
COMMISSION NUMBER(3,2)
FROM employee
WHERE commission =
(SELECTcommission
FROMemployee
WHEREUPPER(first_name) = 'SCOTT')
A. There is more than one 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?
FROM EMP;
FROM EMP;
D. CREATE REPORT
FROM EMP;
FROM EMP;
Answer: C
QUESTION NO: 87
Answer: D
QUESTION NO: 88
Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE tables.
ON employee(dept_id);
E. Override the unique index created when the FK relationship was defined.
Answer: B
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.
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?
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
ADDRESS VARCHAR2(50)
GRADUATION DATE
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?
A. UPDATE student
graduation = '29-MAY-2001'
B. UPDATE student
graduation = '15-AUG-2000'
C. UPDATE student
graduation = '29-MAY-2001'
D. UPDATE student
Answer: B
QUESTION NO: 92
Examine this block of code:
SET SERVEROUTPUT ON
DECLARE
x NUMBER;
v_sal NUMBER;
BEGIN
x := 1;
v_sal := 1000;
DECLARE
v_found VARCHAR2(10);
y NUMBER;
BEGIN
v_found := 'YES';
END IF;
y := 20;
END;
END;
B. Variable Y is declared in the inner block and referenced in the outer block.
D. Variable V_SAL is declared in the outer block and referenced in the inner block.
Answer: B
QUESTION NO: 93
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
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
IS
FROM emp
BEGIN
...
B. OPEN emp_cursor;
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?
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?
FROM employee
WHERE id = 3;
FROM employee
WHERE id = 3;
FROM employee
WHERE id = 3;
FROM employee;
Answer: A
QUESTION NO: 98
NAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SALARY NUMBER(7,2)
COMM NUMBER(7,2)
TAX Table
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?
Answer: A
QUESTION NO: 99
Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEE tables.
E. Override the unique index created when the FK relationship was defined.
Answer: A
2.(employee_idNUMBER(9)
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
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
FROM cars
FROM cars
FROM cars
Answer: C
ADDRESS VARCHAR2(50)
GRADUATION DATE
VALUES (101,'Smith');
Answer: C
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
FROM employee
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.
FROMplayer p, player m
WHEREm.id = p.manager_id;
FROMplayer p, player m
WHEREm.manager_id = p.id;
D. The results will be the same, but the display will be different.
Answer: D
QUESTION NO: 107
FROM employee
GROUP BY dept_no
Answer: D
DECLARE
v_result NUMBER(2);
BEGIN
DELETE
FROM employee
v_result := SQL%ROWCOUNT;
COMMIT;
END;
A. 0
B. NULL
C. FALSE
D. 1
E. TRUE
Answer: A
Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)
E. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.
Answer: C,D
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
DECLARE
dept_rec dept%ROWTYPE;
BEGIN
SELECT *
INTO dept_rec
FROM dept
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
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)
HAVING AVG(outer.sal) IN
(SELECT inner.sal
B. SELECT outer.ename,outer.sal,
outer.deptno,AVG(outer.sal)
FROM emp outer
(SELECT inner.sal
FROM emp
FROM emp
GROUP BY deptno) b
Answer: D
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
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
BEGIN
&deptno);
END;
B. DECLARE
BEGIN
&deptno);
END;
C. DECLARE
BEGIN
&deptno)
END;
D. DECLARE
BEGIN
&deptno);
END;
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.)
FROM item
FROM item
FROM item
FROM item
FROM item
FROM item
FROM item
FROM item
Answer: A
QUESTION NO: 115
BEGIN
IF i = 4 OR i = 6 THEN
null;
ELSE
VALUES (I);
END IF;
COMMIT;
END LOOP;
ROLLBACK;
END;
A. 8
B. 10
C. 4
D. 6
E. 0
Answer: A
QUESTION NO: 116
(purchase_no NUMBER(9)
customer_id NUMBER(9)
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.
VALUES (patient_id_seq.NEXTVALUE)
/
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.
FROM ord;
B. SELECT custid, orderdate, shipdate,
FROM ord;
FROM ord;
"Time Taken"
FROM ord;
Answer: D
BONUSNUMBER(7,2)
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.
DECLARE
v_bonusemployee.bonus%TYPE := 300;
BEGIN
UPDATE employee
COMMIT;
END;
Answer: C
AS
FROM emp
GROUP BY deptno;
What happens when the following command is issued?
UPDATE emp_view
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
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?
FROM cars
FROM cars
FROM cars
FROM cars
Answer: D
QUESTION NO: 124
Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.
SELECT pr.name
WHEREpt.product_id(+) = pr.id;
B. An error is generated.
Answer: C
QUESTION NO: 125
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
DECLARE
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
FROM user_objects;
2.SELECTobject_type
FROM all_objects;
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
IF n1 > n2 THEN
p_max := n1;
ELSE
p_max := n2;
END;
FROM emp
D. BEGIN
emp_rec emp%ROWTYPE;
END;
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.
10 21.43 30.15 2
0 35.71 37.47
30 42.86 32.39
FROM scott.emp
GROUP BY deptno;
B. SELECT
a.deptno "Department",
FROM
FROM scott.emp
GROUP BY deptno) a,
FROM scott.emp) b;
PCT(empno) "%Employees",
PCT(sal) "%Salary"
FROM scott.emp
GROUP BY deptno;
FROM
FROM scott.emp
GROUP BY deptno) a;
Answer: B
A. INDEX
C. DELETE
D. UPDATE
E. ALTER
Answer: B
QUESTION NO: 130
AS
FROM emp
GROUP BY deptno;
UPDATE emp_view
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.
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.
MAXVALUE 999999999
STEP BY 1;
ON patient (patient_id)
MINVALUE 1000
MAXVALUE 999999999
INCREMENT BY 1
NOCYCLE;
MAXVALUE 999999999
NOCYCLE;
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:
YEARLY_SAL NUMBER(9,2)
MONTHLY_SAL NUMBER(9,2)
A. SELECT *
B. SELECT *
FROM EMPLOYEE;
C. SELECT *
FROM ann_sal;
D. SELECT *
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.
FROMplayer p, player m
WHEREm.id = p.manager_id;
FROMplayer p, player m
WHEREm.manager_id = p.id;
A. The results will be the same, but the display will be different.
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;
D. An error is generated.
Answer: B
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
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.
Answer: D
SET SERVEROUTPUT ON
DECLARE
v_char_val VARCHAR2(100);
BEGIN
DBMS_OUTPUT.PUT_LINE(v_char_val);
END;
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
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?
FROM emp
GROUP BY deptno
FROM emp
WHERE deptno IN (20, 50)
GROUP BY deptno
FROM emp
GROUP BY AVG(sal)
FROM emp
GROUP BY deptno;
Answer: B
FROM employee
ORDER BY last_name;
B. FROM employee
C. ORDER BY last_name
D. GROUP BY dept_no
Answer: D
DECLARE
Answer: A
A. ('03-JUL-96' - '04-JUL-97') / 7
B. ('03-JUL-96' - '04-JUL-97') / 12
D. '03-JUL-96' - '04-JUL-97'
E. '03-JUL-96' + 7
F. '03-JUL-96' - 12
Answer: C,E,F
QUESTION NO: 143
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.
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
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
DECLARE
(dno NUMBER,
name VARCHAR2(20));
dept_rec dept_record_type;
BEGIN
SELECT deptno, dname
INTO dept_rec
FROM dept
END;
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.
NVL(total,'Not Available')
FROM order;
FROM order;
NVL(TO_CHAR(total),'Not Available')
FROM order;
TO_CHAR(total,'Not Available')
FROM order;
Answer: C
SELECT employee.ename
(SELECT manager.mgr
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;
ROUND(AVG(cost),2)
FROM part
GROUP BY product_id;
A. Statement 1 will only display one row of results; statement 2 could display more than one.
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.
Answer: A
A. invoices-1996
B. catch_#22
C. 1996_invoices
D. number
E. #_667
Answer: B
QUESTION NO: 151
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?
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.
E. Only the future values are verified to confirm with the constraints, leaving the existing values
unchecked.
Answer: D
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
DECLARE
(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 *
B. You can not retrieve the entire row using the DEPT_REC variable declared in the code.
INTO dept_rec
FROM dept
D. SELECT *
INTO dept_rec
FROM dept
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
UPDATE emp
END IF;
END;
B. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
UPDATE emp
END IF;
END;
C. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
UPDATE emp
END IF;
END;
D. DECLARE
v_sal emp.sal%TYPE;
BEGIN
SELECT sal
INTO v_sal
FROM emp
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?
IDENTIFIED BY lion;
PASSWORD BY lion;
IDENTIFIED BY lion;
Answer: E
FOR ed.employee;
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.
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
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
A. USER_VIEWS
B. SYSTEM_VIEWS
C. USER_TAB_VIEWS
D. MY_VIEWS
Answer: A
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.
Answer: B
ADDRESS VARCHAR2(50)
GRADUATION DATE
Which statement adds a new column after the NAME column to hold phone numbers?
C. You cannot specify the position where a new column has to be added.
Answer: C
2.SELECT object_type
FROM all_objects;
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;
KEEP STRUCTURE;
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.
C. Jane can access the table, but she cannot see your changes. She can make the changes for you.
Answer: A
v_new_value := 2 * v_value;
v_new_value := 4 * v_value;
ELSE
v_new_value := 5 * v_value;
END IF;
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
FROM emp
END IF;
END;
Which statement causes a compilation error when the above PL/SQL block is executed?
FROM emp
C. v_name emp.ename%TYPE;
D. v_num NUMBER;
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?
FROM emp
FROM emp
FROM emp
FROM emp
Answer: B
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.
FROMemployee
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.
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
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.
B. Jane can access the table, but she cannot see your changes. She can make the changes for you.
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
BEGIN
INSERT INTO emp(empno, ename, hiredate, deptno)
&deptno);
END;
B. DECLARE
BEGIN
&deptno);
END;
C. DECLARE
BEGIN
&deptno);
END;
D. DECLARE
BEGIN
&deptno)
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
B. DELETE
FROM patient
C. DEFINE :id_number
DELETE
FROM patient
E. DELETE
DEFINE &id_number
FROM patient
Answer: B