Oracle 1z0-001: Practice ExamQUESTION NO: 1The PLAYER table contains these columns:ID NUMBER(9)NAME VARCHAR(2)MANAGER_ID N...
Oracle 1z0-001: Practice ExamWhich statement is true when a DROP TABLE command is executed on a table?A. Any pending trans...
Oracle 1z0-001: Practice ExamCREATE ROLE clerk;CREATE ROLE inventory;CREATE USER scott IDENTIFIED BY tiger;GRANT inventory...
Oracle 1z0-001: Practice ExamCOMMIT command. What can Jane do to the employee table?A. Jane can access the table, but she ...
Oracle 1z0-001: Practice ExamB. Null values are displayed last in ascending sequences.C. The results are sorted by the fir...
Oracle 1z0-001: Practice ExamA. The block will not execute because the variable was not initialized.The block will not exe...
Oracle 1z0-001: Practice ExamB. DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;BEGINFOR emp_rec IN emp_cursor LOO...
Oracle 1z0-001: Practice ExamA. PL/SQL table of scalarsB. PL/SQL table of recordsC. %ROWTYPE variableD. PL/SQL recordAnswe...
Oracle 1z0-001: Practice ExamWhat will be the value of V_RESULT if no rows are deleted?A. 1B. NULLC. 0D. FALSEE. TRUEAnswe...
Oracle 1z0-001: Practice ExamB. GRANT CREATE TABLE, CREATE PACKAGETO smith;C. GRANT CREATE TABLE, CREATE PROCEDURETO smith...
Oracle 1z0-001: Practice ExamA. Drop the patient_vu, then create a new view with a WHERE clause.B. Replace the view adding...
Oracle 1z0-001: Practice ExamName Null? Type----------------- ----------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT N...
Oracle 1z0-001: Practice ExamB. This information cannot be retrieved from a single data dictionary view.C. ALL_SOURCED. TA...
Oracle 1z0-001: Practice ExamWHERE e.salary BETWEEN t.lowsal AND t.highsal;C. SELECT e.name, e.salary, t.taxgradeFROM emp ...
Oracle 1z0-001: Practice ExamExamine the data in the GRADDATE table:GRADUATION--------------20-JAN-199912-MAY-199919-JAN-2...
Oracle 1z0-001: Practice ExamFROM employeeWHERE commission =(SELECTcommissionFROMemployeeWHEREUPPER(first_name) = SCOTT)Wh...
Oracle 1z0-001: Practice ExamIn which section of a PL/SQL block is a user-defined exception raised?A. exception handlingB....
Oracle 1z0-001: Practice ExamLAST_NAME VARCHAR2(25)Evaluate these two SQL statements:1. SELECT CONCAT(first_name, last_nam...
Oracle 1z0-001: Practice ExamFROM employeeWHERE salary IN(SELECT salaryFROM employeeWHERE dept_no = 3 OR dept_no = 5);Whic...
Oracle 1z0-001: Practice ExamYou issue this SQL statement:SELECT id, sale_price * 1.25 - cost * 1.10FROMproduct;Which conc...
Oracle 1z0-001: Practice ExamQUESTION NO: 41Examine the structure of the STUDENT table:Name Null? Type---------------- ---...
Oracle 1z0-001: Practice Examemployee Smith who was born in 1944 and hired in 2004. Which statement will ensure that value...
Oracle 1z0-001: Practice ExamC. SELECT hire_date (DD "of" MONTH YYYY) "Date Hired"FROM employee;D. SELECT TO_CHAR(hire_dat...
Oracle 1z0-001: Practice ExamA. You cannot rename a column.B. You use the ALTER TABLE command with the RENAME COLUMN claus...
Oracle 1z0-001: Practice Exam2.Include the availability of each book.3.Order the results by the author.Evaluate this SQL s...
Oracle 1z0-001: Practice ExamIF (v_sal > 500) THENv_found := YES;END IF;DBMS_OUTPUT.PUT_LINE (Value of v_found is || v_fou...
Oracle 1z0-001: Practice ExamSALARY NUMBER(7,2)COMM NUMBER(7,2)DEPTNO NOT NULL NUMBER(2)TAX TableName Null? Type----------...
Oracle 1z0-001: Practice ExamA. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999STEP BY 1;B. This task cann...
Oracle 1z0-001: Practice ExamA. A single row subquery is used with a multiple row comparison operator.B. A multiple row su...
Oracle 1z0-001: Practice Exam1 DECLARE2 i NUMBER := 0;3 v_date DATE;4 BEGIN5 i := i+1;6 LOOP7 v_date := v_date + 5;8 i := ...
Oracle 1z0-001: Practice ExamFROM product;Which conclusion can you draw from the results?A. A function needs to be include...
Oracle 1z0-001: Practice ExamFROM ord;D. SELECT custid, orderdate, shipdate,ROUND(MONTHS_BETWEEN (shipdate, orderdate))"Ti...
Oracle 1z0-001: Practice ExamAnswer: AQUESTION NO: 61Evaluate this SQL script:CREATE ROLE manager;CREATE ROLE clerk;CREATE...
Oracle 1z0-001: Practice ExamFROM employeeWHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60GROUP BY dept_noORDER BY AVG(M...
Oracle 1z0-001: Practice ExamAnswer: DQUESTION NO: 65You issue this command:CREATE SYNONYM empFOR ed.employee;Which task h...
Oracle 1z0-001: Practice ExamQUESTION NO: 67Evaluate this PL/SQL block:BEGINFOR i IN 1..5 LOOPIF i = 1 THEN null;ELSIF i =...
Oracle 1z0-001: Practice ExamExamine the structure of the STUDENT table:Name Null? Type------------- ----------------- ---...
Oracle 1z0-001: Practice ExamHow many values will be inserted into the TEST table?A. 4B. 8C. 0D. 10E. 6Answer: BQUESTION N...
Oracle 1z0-001: Practice ExamC. You eliminate the need to grant SELECT privileges on the table used in the FROM clausesubq...
Oracle 1z0-001: Practice ExamSTUD_ID NOT NULL NUMBER(3)NAME VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATECurrently, the ...
Oracle 1z0-001: Practice ExamA. HAVING COUNT(*) > 10B. WHERE model = FireC. GROUP BY lot_noD. ORDER BY COUNT(*)E. SELECT l...
Oracle 1z0-001: Practice Examp_max := n1;ELSEp_max := n2;END;D. BEGINemp_rec emp%ROWTYPE;END;Answer: BQUESTION NO: 79A DBA...
Oracle 1z0-001: Practice ExamD. ACCEPT table PROMPT Table to view primary key constraint: SELECT constraint_nameFROM user_...
Oracle 1z0-001: Practice ExamAnswer: AQUESTION NO: 83You need to retrieve the employee names and salaries from your EMP ta...
Oracle 1z0-001: Practice ExamWhat would cause this statement to fail?A. There is more than one employee with the first nam...
Oracle 1z0-001: Practice ExamAnswer: CQUESTION NO: 87Which should you do after each FETCH statement in a PL/SQL block?A. O...
Oracle 1z0-001: Practice ExamQUESTION NO: 89Your company wants to give each employee a $100 salary increment. You need to ...
Oracle 1z0-001: Practice ExamExamine the structure of the STUDENT table:Name Null? Type------------- ----------- ---------...
Oracle 1z0-001: Practice ExamAnswer: BQUESTION NO: 92Examine this block of code:SET SERVEROUTPUT ONDECLAREx NUMBER;v_sal N...
Oracle 1z0-001: Practice ExamClick on the EXHIBIT button and examine the table instance chart for the employee table.You w...
Oracle 1z0-001: Practice ExamDECLARECURSOR emp_cursor(p_deptno NUMBER, p_job VARCHAR2)ISSELECT empno, enameFROM empWHERE d...
Oracle 1z0-001: Practice ExamB. SELECT last_name, salaryFROM employeeINTO v_last_name, v_salaryWHERE id = 3;C. SELECT last...
Oracle 1z0-001: Practice ExamWHERE e.salary BETWEEN t.lowsal AND t.highsal;B. SELECT e.name, e.salary, t.taxgradeFROM emp ...
Oracle 1z0-001: Practice ExamQUESTION NO: 100You attempt to create the salary table with this command:1.CREATE TABLE salar...
Oracle 1z0-001: Practice ExamB. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = &model;C. SELECT style, color, lo...
Oracle 1z0-001: Practice ExamWhich datatype would be most appropriate to store this data?A. LONGB. LONG RAWC. NUMBER(p)D. ...
Oracle 1z0-001: Practice ExamA. SouthallB. noneC. ChiazzaD. BrownAnswer: CQUESTION NO: 106The PLAYER table contains these ...
Oracle 1z0-001: Practice ExamB. Statement 1 is self-join; statement 2 is not.C. Statement 1 will execute; statement 2 will...
Oracle 1z0-001: Practice ExamA. 0B. NULLC. FALSED. 1E. TRUEAnswer: AQUESTION NO: 109Which two conditions in a PL/SQL block...
Oracle 1z0-001: Practice ExamA. DBMS_OUTPUT.PUT_LINE (dept_rec.loc);B. DBMS_OUTPUT.PUT_LINE (dept_rec);C. You cannot displ...
Oracle 1z0-001: Practice ExamYou need to execute a script file named QUERYEMP.SQL from your SQL*Plus environment.Which com...
Oracle 1z0-001: Practice Exam&deptno);END;Answer: BQUESTION NO: 114Which SELECT statement displays the order id, product i...
Oracle 1z0-001: Practice ExamQUESTION NO: 115Evaluate this PL/SQL block:BEGINFOR i IN 1..10 LOOPIF i = 4 OR i = 6 THENnull...
Oracle 1z0-001: Practice ExamB. An index is created for each column.C. An index is created for the customer_id column.D. A...
Oracle 1z0-001: Practice ExamQUESTION NO: 118How do you send the output of your SQL*Plus session to a text operating syste...
Oracle 1z0-001: Practice ExamDEPT_ID NUMBER(9)There are 10 departments and each department has at least 1 employee. Bonus ...
Oracle 1z0-001: Practice ExamB. The SAL column in the EMP table is updated to 20000 for employees in department 10.C. The ...
Oracle 1z0-001: Practice ExamD. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = UPPER(&model);Answer: DQUESTION N...
Oracle 1z0-001: Practice ExamDECLARETYPE dept_table_type IS TABLE OF dept%ROWTYPEINDEX BY BINARY_INTEGER;dept_table dept_t...
Oracle 1z0-001: Practice ExamA. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) ISBEGINIF n1 > n2 THENp_max := n...
Oracle 1z0-001: Practice ExamROUND(a.sal_sum/b.total_sal * 100, 2) "%Salary"FROM(SELECT deptno, COUNT(*) num_emp, SUM(SAL)...
Oracle 1z0-001: Practice ExamGROUP BY deptno;What happens when the following command is issued?UPDATE emp_viewSET tot_sal ...
Oracle 1z0-001: Practice ExamNOCYCLE;D. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999NOCYCLE;Answer: DQU...
Oracle 1z0-001: Practice ExamAnswer: CQUESTION NO: 134The PLAYER table contains these columns:ID NUMBER(9)NAME VARCHAR(2)M...
Oracle 1z0-001: Practice ExamA. A list of products is displayed for parts that have products assigned.B. A list of all pro...
Oracle 1z0-001: Practice ExamSET SERVEROUTPUT ONDECLAREv_char_val VARCHAR2(100);BEGINv_char_val := Hello World;DBMS_OUTPUT...
Oracle 1z0-001: Practice ExamWHERE deptno IN (20, 50)AND AVG(sal) >= 2000GROUP BY deptno;Answer: BQUESTION NO: 140Click on...
Oracle 1z0-001: Practice ExamGiven this CURSOR statement:DECLARECURSOR query_cursor (v_salary) ISSELECT last_name, salary,...
Oracle 1z0-001: Practice ExamQUESTION NO: 144Which statement describes the use of a group function?A. A group function pro...
Oracle 1z0-001: Practice ExamFROM deptWHERE deptno = 10;END;Which statement displays the name of the selected department?A...
Oracle 1z0-001: Practice ExamExamine the code:SELECT employee.enameFROM emp employeeWHERE employee.empno NOT IN(SELECT man...
Oracle 1z0-001: Practice ExamB. The results will be the same, but the display will differ.C. Statement 1 will display a re...
Oracle 1z0-001: Practice ExamE. Only the future values are verified to confirm with the constraints, leaving the existing ...
Oracle 1z0-001: Practice ExamQUESTION NO: 154You need to update employee salaries. If the salary of an employee is less th...
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
1 z0 001
Upcoming SlideShare
Loading in...5
×

1 z0 001

2,023

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,023
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
65
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

1 z0 001

  1. 1. Oracle 1z0-001: Practice ExamQUESTION NO: 1The PLAYER table contains these columns:ID NUMBER(9)NAME VARCHAR(2)MANAGER_ID NUMBER(9)In this instance, managers are players and you need to display a list of players.Evaluate these two SQL statements:SELECT p.name, m.nameFROMplayer p, player mWHEREm.id = p.manager_id;SELECT p.name, m.nameFROMplayer p, player mWHEREm.manager_id = p.id;How will the results differ?A. Statement 1 will not execute; statement 2 will.B. The results will be the same, but the display will be different.C. Statement 1 will execute; statement 2 will not.D. Statement 1 is self-join; statement 2 is not.Answer: BQUESTION NO: 2Under which situation is it necessary to use an explicit cursor?A. when a SELECT statement in a PL/SQL block retrieves more than one rowB. when an UPDATE statement in a PL/SQL block has to modify more than one rowC. when a DELETE statement in a PL/SQL block deletes more than one rowD. when any DML or SELECT statement is used in a PL/SQL blockAnswer: AQUESTION NO: 3 "Pass Any Exam. Any Time." - Guaranteed 2
  2. 2. Oracle 1z0-001: Practice ExamWhich statement is true when a DROP TABLE command is executed on a table?A. Any pending transactions on the table are rolled back.B. The table structure and its deleted data cannot be rolled back and restored once the DROPTABLE command is executed.C. The DROP TABLE command can be executed on a table on which there are pendingtransactions.D. The structure of the table remains in the database, and the data and indexes are deleted.E. Only a DBA can execute the DROP TABLE command.Answer: BQUESTION NO: 4Which statement about implicit cursors is true?A. Programmers need to close all the implicit cursors before the end of the PL/SQL program.B. Programmers can declare implicit cursors by using the CURSOR type in the declarationsection.C. Implicit cursors are declared implicitly only for DML statements.D. Implicit cursors are declared implicitly for all the DML and SELECT statements.Answer: DQUESTION NO: 5How would you add a foreign key constraint on the dept_no column in the EMP table, referring tothe 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: AQUESTION NO: 6Evaluate this SQL script:CREATE ROLE manager; "Pass Any Exam. Any Time." - Guaranteed 3
  3. 3. Oracle 1z0-001: Practice ExamCREATE ROLE clerk;CREATE ROLE inventory;CREATE USER scott IDENTIFIED BY tiger;GRANT inventory TO clerk;GRANT clerk TO manager;GRANT inventory TO scott/How many roles will user SCOTT have access to?A. 1B. 2C. 0D. 3Answer: AQUESTION NO: 7You want to display the details of all employees whose last name is Smith, but you are not sure inwhich case the last names are stored. Which statement will list all the employees whose last nameis Smith?A. SELECT lastname, firstnameFROM empWHERE LOWER(lastname) = smith;B. SELECT lastname, firstnameFROM empWHERE UPPER(lastname) = smith;C. SELECT lastname, firstnameFROM empWHERE lastname = smith;D. SELECT lastname, firstnameFROM empWHERE lastname = UPPER(smith);Answer: AQUESTION NO: 8You are updating the employee table. Jane has been granted the same privileges as you on theemployee table. You ask Jane to log on to the database to check your work before you issue a "Pass Any Exam. Any Time." - Guaranteed 4
  4. 4. Oracle 1z0-001: Practice ExamCOMMIT 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 samechanges.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 foryou.Answer: AQUESTION NO: 9Click on the EXHIBIT button and examine the table instance chart for the sales table.You attempt to change the database with this command:INSERT INTO sales (purchase_no, customer_id, car_id)VALUES (1234, 345, 6);If this statement fails, which condition would explain the failure?A. The sales table has too many foreign keys.B. The statement has invalid datatypes.C. A mandatory column value is missing.D. This statement does not fail at all.Answer: CQUESTION NO: 10Which statement about SQL is true?A. Date values are displayed in descending order by default. "Pass Any Exam. Any Time." - Guaranteed 5
  5. 5. Oracle 1z0-001: Practice ExamB. Null values are displayed last in ascending sequences.C. The results are sorted by the first column in the SELECT list if the ORDER BY clause is notprovided.D. You cannot specify a column alias in an ORDER BY clause.E. You cannot sort query results by a column that is not included the SELECT list.Answer: BQUESTION NO: 11Evaluate this SQL statement:SELECTe.id, (.15 * e.salary) + (.25 * e.bonus) + (s.sale_amount * (.15 * e.commission_pct))FROMemployee e, sale sWHEREe.id = s.emp_id;What would happen if you removed all the parentheses from the calculation?A. The results will be lower.B. The statement will achieve the same results.C. The statement will not execute.D. The results will be higher.Answer: BQUESTION NO: 12Within a PL/SQL loop, you need to test if the current fetch was successful. Which SQL cursorattribute would you use to accomplish this task?A. A SQL cursor attribute cannot be used within a PL/SQL loop.B. This task cannot be accomplished with a SQL cursor attribute.C. SQL%ROWCOUNTD. SQL%ISOPENE. SQL%FOUNDAnswer: EQUESTION NO: 13In the declarative section of a PL/SQL block, you created but did not initialize a number variable.When the block executes, what will be the initial value of the variable? "Pass Any Exam. Any Time." - Guaranteed 6
  6. 6. Oracle 1z0-001: Practice ExamA. The block will not execute because the variable was not initialized.The block will not executebecause the variable was not initialized.B. 0C. nullD. It depends on the scale and precision of the variable.Answer: CQUESTION NO: 14Examine the code:DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;emp_rec emp_cursor%ROWTYPE;BEGINOPEN emp_cursor;LOOPFETCH emp_cursorINTO 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. DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;BEGINFOR emp_rec IN emp_cursor LOOPINSERT INTO temp_emp(name, dno)VALUES (emp_rec.ename, emp_rec.deptno);END LOOP;CLOSE emp_cursor;END; "Pass Any Exam. Any Time." - Guaranteed 7
  7. 7. Oracle 1z0-001: Practice ExamB. DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;BEGINFOR emp_rec IN emp_cursor LOOPINSERT INTO temp_emp(name, dno)VALUES (emp_rec.ename, emp_rec.deptno);END LOOP;END;C. DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;emp_rec emp_cursor%ROWTYPE;BEGINFETCH emp_cursorINTO emp_rec;FOR emp_rec IN emp_cursor LOOPINSERT INTO temp_emp(name, dno)VALUES (emp_rec.ename, emp_rec.deptno);END LOOP;END;D. DECLARECURSOR emp_cursor ISSELECT ename, deptnoFROM emp;BEGINFOR emp_rec IN emp_cursor LOOPOPEN emp_cursor;INSERT INTO temp_emp(name, dno)VALUES (emp_rec.ename, emp_rec.deptno);END LOOP;END;Answer: BQUESTION NO: 15You 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 columnsusing a single SELECT statement from the EMP table? "Pass Any Exam. Any Time." - Guaranteed 8
  8. 8. Oracle 1z0-001: Practice ExamA. PL/SQL table of scalarsB. PL/SQL table of recordsC. %ROWTYPE variableD. PL/SQL recordAnswer: BQUESTION NO: 16Given this executable section of a PL/SQL block:BEGINFOR employee_record IN salary_cursor LOOPemployee_id_table(employee_id) :=employee_record.last_name;END LOOP;CLOSE salary_cursor;END;Why does this section cause an error?A. The cursor does not need to be closed.B. No FETCH statements were issued.C. Terminating conditions are missing.D. The cursor needs to be opened.Answer: AQUESTION NO: 17Evaluate this PL/SQL block:DECLAREv_result NUMBER(2);BEGINDELETEFROM employeeWHERE dept_id IN (10, 20, 30);v_result := SQL%ROWCOUNT;COMMIT;END; "Pass Any Exam. Any Time." - Guaranteed 9
  9. 9. Oracle 1z0-001: Practice ExamWhat will be the value of V_RESULT if no rows are deleted?A. 1B. NULLC. 0D. FALSEE. TRUEAnswer: CQUESTION NO: 18Which SELECT statement displays all the employees who do not have any subordinates?A. SELECT e.enameFROM emp eWHERE e.empno NOT IN (SELECT m.mgrFROM emp mWHERE m.mgr IS NOT NULL);B. SELECT e.enameFROM emp eWHERE e.empno IN (SELECT m.mgrFROM emp m);C. SELECT e.enameFROM emp eWHERE e.mgr IS NOT NULL;D. SELECT e.enameFROM emp eWHERE e.empno NOT IN (SELECT m.mgrFROM emp m);Answer: AQUESTION NO: 19As a DBA, you have just created a user account for employee Smith by using the CREATE USERcommand. Smith should be able to create tables and packages in his schema. Which commandwill the DBA need to execute next so that Smith can perform his tasks successfully?A. GRANT CREATE CONNECT, CREATE TABLE, CREATE PROCEDURETO smith; "Pass Any Exam. Any Time." - Guaranteed 10
  10. 10. Oracle 1z0-001: Practice ExamB. GRANT CREATE TABLE, CREATE PACKAGETO smith;C. GRANT CREATE TABLE, CREATE PROCEDURETO smith;D. GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURETO smith;Answer: DQUESTION NO: 20Evaluate this IF statement:IF v_value > 100 THENv_new_value := 2 * v_value;ELSIF v_value > 200 THENv_new_value := 3 * v_value;ELSIF v_value < 300 THENv_new_value := 4 * v_value;ELSEv_new_value := 5 * v_value;END IF;What would be assigned to V_NEW_VALUE if V_VALUE is 250?A. 250B. 1250C. 750D. 500E. 1000Answer: DQUESTION NO: 21Click 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. Whatis the best way to modify the view to contain only those patients born in 1997? "Pass Any Exam. Any Time." - Guaranteed 11
  11. 11. Oracle 1z0-001: Practice ExamA. 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: BQUESTION NO: 22Mr. King is the president of a company. Five managers report to him. All other employees report tothese managers.Examine the code:SELECT employee.enameFROM emp employeeWHERE employee.empno NOT IN(SELECT manager.mgrFROM emp manager);The above statement returnsno rows selected.as the result. Why?A. None of the employees has a manager.B. A NULL value is returned from the subquery.C. All employees have a manager.D. NOT IN operator is not allowed in subqueries.Answer: BQUESTION NO: 23Examine the structure of the STUDENT table: "Pass Any Exam. Any Time." - Guaranteed 12
  12. 12. Oracle 1z0-001: Practice ExamName Null? Type----------------- ----------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATEWhich statement inserts a new row into the STUDENT table?A. INSERT INTO student (stud_id, address, graduation)VALUES (101,100 Main Street,17-JUN-99);B. INSERT INTO student (stud_id, address, name, graduation)VALUES (101,100 Main Street,Smith,17-JUN-99);C. INSERT INTO studentVALUES (101,100 Main Street,17-JUN-99,Smith);D. INSERT INTO studentVALUES (101,Smith);E. INSERT INTO student tableVALUES (101,Smith,100 Main Street,17-JUN-99);Answer: BQUESTION NO: 24Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?A. LIKE operatorB. IN operatorC. equal operatorD. greater than or equal to operatorE. BETWEEN x AND y operatorAnswer: CQUESTION NO: 25You 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 onand the schema that owns the employee table?A. ALL_TABLES "Pass Any Exam. Any Time." - Guaranteed 13
  13. 13. Oracle 1z0-001: Practice ExamB. This information cannot be retrieved from a single data dictionary view.C. ALL_SOURCED. TABLE_PRIVILEGESE. ALL_COL_PRIVS_RECDF. ALL_OBJECTSAnswer: EQUESTION NO: 26Examine the table structures:EMP TableName Null? Type------------------------------- ------------- -----------EMPNO NOT NULL NUMBER(4)NAME VARCHAR2(10)JOB VARCHAR2(9)MGR NUMBER(4)HIREDATE DATESALARY NUMBER(7,2)COMM NUMBER(7,2)DEPTNO NOT NULL NUMBER(2)TAX TableName Null? Type------------------------------- -------- -----------TAXGRADE NUMBERLOWSAL NUMBERHIGHSAL NUMBERYou want to create a report that displays the employee details along with the tax category of eachemployee. The tax category is determined by comparing the salary of the employee from the EMPtable to the lower and upper salary values in the TAX table.Which SELECT statement produces the required results?A. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary IN t.lowsal AND t.highsal;B. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax t "Pass Any Exam. Any Time." - Guaranteed 14
  14. 14. Oracle 1z0-001: Practice ExamWHERE e.salary BETWEEN t.lowsal AND t.highsal;C. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary >= t.lowsal AND <= t.highsal;D. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary <= t.lowsal AND e.salary >= t.highsal;Answer: BQUESTION NO: 27How do you declare a PL/SQL table of records to hold the rows selected from the EMP table?A. DECLAREemp_table IS TABLE OF emp%ROWTYPE;B. DECLARETYPE emp_table_type IS TABLE OF emp%ROWTYPEINDEX BY BINARY_INTEGER;emp_table emp_table_type;C. BEGINTYPE emp_table_type IS TABLE OF emp%ROWTYPE;emp_table emp_table_type;D. DECLARETYPE emp_table_type IS TABLE OF emp%ROWTYPEINDEX BY WHOLE_NUMBER;emp_table emp_table_type;Answer: BQUESTION NO: 28Examine the structure of the STUDENT table:Name Null? Type------------------ -------------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATEGraduation column is a foreign key column to the GRADDATE table. "Pass Any Exam. Any Time." - Guaranteed 15
  15. 15. Oracle 1z0-001: Practice ExamExamine the data in the GRADDATE table:GRADUATION--------------20-JAN-199912-MAY-199919-JAN-200025-MAY-200013-JAN-200129-MAY-2001Which update statement produces the following error?ORA-02291: integrity constraint (SYS_C23) violated - parent key not foundA. UPDATE studentSET name = Smith,graduation = 15-AUG-2000WHERE stud_id = 101;B. UPDATE studentD.UPDATE studentSET stud_id = NULL,address = 100 Main StreetWHERE graduation = 20-JAN-1999;C. UPDATE studentSET name = Smith,graduation = 29-MAY-2001WHERE stud_id = 101;D. UPDATE studentSET stud_id = 999,graduation = 29-MAY-2001WHERE stud_id = 101;Answer: AQUESTION NO: 29The EMPLOYEE table contains these columns:FIRST_NAMEVARCHAR2(25)COMMISSION NUMBER(3,2)Evaluate this SQL statement:SELECT first_name, commission "Pass Any Exam. Any Time." - Guaranteed 16
  16. 16. Oracle 1z0-001: Practice ExamFROM employeeWHERE commission =(SELECTcommissionFROMemployeeWHEREUPPER(first_name) = SCOTT)What would cause this statement to fail?A. Scott has a NULL commission value.B. There is no employee with the first name Scott.C. The FIRST_NAME values in the database are in lowercase.D. Scott has a zero commission value.E. There is more than one employee with the first name Scott.Answer: EQUESTION NO: 30The EMPLOYEE table contains these columns:LAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)SALARY NUMBER(7,2)You need to display the names of employees that earn more than the average salary of allemployees.Evaluate this SQL statement:SELECT last_name, first_nameFROMemployeeWHEREsalary > AVG(salary);Which change should you make to achieve the desired results?A. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.B. Change the function in the WHERE clause.C. Move the function to the SELECT clause and add a GROUP BY clause.D. Use a subquery in the WHERE clause to compare the average salary value.Answer: DQUESTION NO: 31 "Pass Any Exam. Any Time." - Guaranteed 17
  17. 17. Oracle 1z0-001: Practice ExamIn which section of a PL/SQL block is a user-defined exception raised?A. exception handlingB. executableC. headingD. declarativeAnswer: BQUESTION NO: 32You are a user of the PROD database which contains over 1000 tables, and you need todetermine the number of tables you can access. Which data dictionary view could you query todisplay this information?A. DBA_TABLESB. ALL_OBJECTSC. USER_OBJECTSD. DBA_SEGMENTSAnswer: BQUESTION NO: 33Using SQL*Plus, you created a user with this command:CREATE USER jennifer IDENTIFIED BY jbw122;What should you do to allow the user database access?A. Grant the user the CREATE SESSION privilege.B. Use the ALTER USER to assign the user a default profile.C. Use the ALTER USER command to assign the user a default tablespace.D. No action is required to give the user database access.Answer: AQUESTION NO: 34The EMPLOYEE table contains these columns:FIRST_NAME VARCHAR2(25) "Pass Any Exam. Any Time." - Guaranteed 18
  18. 18. Oracle 1z0-001: Practice ExamLAST_NAME VARCHAR2(25)Evaluate these two SQL statements:1. SELECT CONCAT(first_name, last_name),LENGTH(CONCAT(first_name, last_name))FROM employeeWHERE UPPER(last_name) LIKE %JORUPPER(last_name) LIKE %KORUPPER(last_name) LIKE %L;2. SELECT INITCAP(first_name) || INITCAP(last_name),LENGTH(last_name) + LENGTH(first_name)FROM employeeWHERE INITCAP(SUBSTR(last_name, 1, 1)) IN (J, K, L);How will the results differ?A. The statements will retrieve different data from the database.B. Statement 1 will execute, but statement 2 will not.C. Statement 2 will execute, but statement 1 will not.D. The statements will retrieve the same data from the database, but will display it differently.Answer: AQUESTION NO: 35Which statement is true when writing a cursor FOR loop?A. You do not explicitly open, fetch or close the cursor within a cursor FOR loop .B. You must explicitly close the cursor prior to the end of the program.C. You must explicitly fetch the rows within a cursor FOR loop.D. You must explicitly declare the record variable that holds the row returned from the cursor.E. You must explicitly open the cursor prior to the cursor FOR loop.Answer: AQUESTION NO: 36You query the database with this command:SELECT last_name, first_name "Pass Any Exam. Any Time." - Guaranteed 19
  19. 19. Oracle 1z0-001: Practice ExamFROM employeeWHERE salary IN(SELECT salaryFROM employeeWHERE dept_no = 3 OR dept_no = 5);Which values are displayed?A. last name and first name of only the employees in department number 3 or 5B. last name and first name of only the employees whose salary falls in the range of salaries fromdepartment 3 or 5C. last name and first name of all employees except those working in department 3 or 5D. last name and first name of all employees with the same salary as employees in department 3or 5Answer: DQUESTION NO: 37You issue this command:CREATE PUBLIC SYNONYM empFOR ed.employee;Which task has been accomplished?A. The need to qualify the object name with its schema was eliminated for only you.B. The need to qualify the object name with its schema has been eliminated for all users.C. The object can now be accessed by all users.D. All users were given object privileges to the table.Answer: BQUESTION NO: 38The PRODUCT table contains these columns:ID NUMBER(9) PKCOST 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 ofeach product is increased by 10% and the sale price of each product is increased by 25%. "Pass Any Exam. Any Time." - Guaranteed 20
  20. 20. Oracle 1z0-001: Practice ExamYou issue this SQL statement:SELECT id, sale_price * 1.25 - cost * 1.10FROMproduct;Which conclusion can you draw from the results?A. The order of the operations in the calculation needs to be changed to achieve the requiredresults.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: BQUESTION NO: 39Which operator is NOT appropriate in the join condition of a non-equi join SELECT statement?A. equal operatorB. LIKE operatorC. IN operatorD. greater than or equal to operatorE. BETWEEN x AND y operatorAnswer: AQUESTION NO: 40Which statement about multiple column subqueries is true?A. In a pairwise subquery, the values returned from the subquery are compared individually to thevalues 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 tothe values in the outer query.D. A pairwise comparison produces a cross product.Answer: B "Pass Any Exam. Any Time." - Guaranteed 21
  21. 21. Oracle 1z0-001: Practice ExamQUESTION NO: 41Examine the structure of the STUDENT table:Name Null? Type---------------- ----------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)PHONE NOT NULL VARCHAR2(9)ADDRESS VARCHAR2(50)GRADUATION DATEThere are 100 records in the STUDENT table. You need to modify the PHONE column to holdonly numeric values.Which statement will modify the datatype of the PHONE column?A. ALTER TABLE studentMODIFY COLUMN phone NUMBER(9);B. ALTER TABLE studentMODIFY phone NUMBER(9);C. You cannot modify the datatype of a column if there is data in the column.D. You cannot modify a VARCHAR2 datatype to a NUMBER datatype for a column.Answer: CQUESTION NO: 42You want to create a cursor that can be used several times in a block, selecting a different activeset each time when it is opened. Which type of cursor do you create?A. a cursor for each active setB. a cursor FOR loopC. a cursor that uses parametersD. a multiple selection cursorAnswer: CQUESTION NO: 43The EMP table contains columns to hold the birth date and hire date of employees. Both of thesecolumns are defined with DATE as their datatype. You want to insert a row with the details of "Pass Any Exam. Any Time." - Guaranteed 22
  22. 22. Oracle 1z0-001: Practice Examemployee Smith who was born in 1944 and hired in 2004. Which statement will ensure that valuesare inserted into the table in the correct century?A. INSERT INTO EMP(empno, ename, birthdate, hiredate)VALUES (EMPNO_SEQ.NEXTVAL,SMITH,TO_DATE(12-DEC-44,DD-MON-YY),TO_DATE(10-JUN-04,DD-MON-YY));B. INSERT INTO EMP(empno, ename, birthdate, hiredate)VALUES (EMPNO_SEQ.NEXTVAL,SMITH,TO_DATE(12-DEC-1944,DD-MON-YYYY),TO_DATE(10-JUN-04,DD-MON-RR));C. INSERT INTO EMP(empno, ename, birthdate, hiredate)VALUES (EMPNO_SEQ.NEXTVAL,SMITH,TO_DATE(12-DEC-44,DD-MON-RR),TO_DATE(10-JUN-04,DD-MON-RR));D. INSERT INTO EMP(empno, ename, birthdate, hiredate)VALUES (EMPNO_SEQ.NEXTVAL,SMITH, 12-DEC-44,10-JUN-04);Answer: BQUESTION NO: 44Click on the EXHIBIT button and examine the table instance chart for the employee table.You need to display the hire_date values in this format:10 of October 1999.Which SELECT statement can you use?A. SELECT hire_date (fmDD "of" MONTH YYYY) "Date Hired"FROM employee;B. SELECT TO_CHAR(hire_date, DDspth of MONTH YYYY) "DATE HIRED"FROM employee; "Pass Any Exam. Any Time." - Guaranteed 23
  23. 23. Oracle 1z0-001: Practice ExamC. SELECT hire_date (DD "of" MONTH YYYY) "Date Hired"FROM employee;D. SELECT TO_CHAR(hire_date, fmDD "of" Month YYYY) DATEHIREDFROM employee;Answer: DQUESTION NO: 45You have decided to permanently remove all the data from the STUDENT table, and you need thetable structure in the future. Which single command performs this?A. DELETE *FROM studentKEEP STRUCTURE;B. TRUNCATE TABLE studentKEEP STRUCTURE;C. DROP TABLE student;D. DELETE *FROM student;E. TRUNCATE TABLE student;Answer: EQUESTION NO: 46Examine the structure of the STUDENT table:Name Null? Type------------------ ---------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)PHONE NOT NULL VARCHAR2(9)ADDRESS VARCHAR2(50)GRADUATION DATEThere are 100 records in the STUDENT table. You want to change the name of theGRADUATION column to GRAD_DATE.Which statement is true? "Pass Any Exam. Any Time." - Guaranteed 24
  24. 24. Oracle 1z0-001: Practice ExamA. You cannot rename a column.B. You use the ALTER TABLE command with the RENAME COLUMN clause to rename thecolumn.C. You use the ALTER TABLE command with the MODIFY COLUMN clause to rename thecolumn.D. You use the ALTER TABLE command with the MODIFY clause to rename the column.Answer: AQUESTION NO: 47The EMPLOYEE table contains these columns:LAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)DEPT_ID NUMBER(9)You need to display the names of employees that are not assigned to a department.Evaluate this SQL statement:SELECT last_name, first_nameFROM employeeWHEREdept_id = NULL;Which change should you make to achieve the desired result?A. Change the operator in the WHERE condition.B. Create an outer join.C. Add a second condition to the WHERE condition.D. Change the column in the WHERE condition.Answer: AQUESTION NO: 48Click on the EXHIBIT button and examine the structure of the BOOK_TITLE, COPY, andCHECK_OUT tables.You need to create the BOOKS_AVAILABLE view.These are the desired results:1.Include the title of each book. "Pass Any Exam. Any Time." - Guaranteed 25
  25. 25. Oracle 1z0-001: Practice Exam2.Include the availability of each book.3.Order the results by the author.Evaluate this SQL statement:CREATE VIEW books_availableASSELECT b.title, c.availabilityFROMbook_title b, copy cWHEREb.id = c.title_idORDER BY b.author;What does the statement provide?A. a syntax errorB. one of the desired resultsC. all of the desired resultsD. two of the desired resultsAnswer: AQUESTION NO: 49Examine this block of code:SET SERVEROUTPUT ONDECLAREx NUMBER;v_sal NUMBER;v_found VARCHAR2(10) := TRUE;BEGINx := 1;v_sal := 1000;DECLAREv_found VARCHAR2(10);y NUMBER;BEGIN "Pass Any Exam. Any Time." - Guaranteed 26
  26. 26. Oracle 1z0-001: Practice ExamIF (v_sal > 500) THENv_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 OFFWhat is the result of executing this block of code?A. Value of v_found is YESValue of v_sal is 1000Value of v_found is YESValue of Y is 20B. Value of v_found is YESValue of v_sal is 1000Value of v_found is TRUEValue of Y is 20C. PLS-00201: identifier Y must be declaredD. Value of v_found is YESValue of v_sal is 1000Value of v_found is TRUEE. PLS-00201: identifier v_sal must be declaredPLS-00201: identifier Y must be declaredAnswer: CQUESTION NO: 50Examine the table structures:EMP Table Name Null? Type------------------------------- -------- --------EMPNO NOT NULL NUMBER(4)NAME VARCHAR2(10)JOB VARCHAR2(9)MGR NUMBER(4)HIREDATE DATE "Pass Any Exam. Any Time." - Guaranteed 27
  27. 27. Oracle 1z0-001: Practice ExamSALARY NUMBER(7,2)COMM NUMBER(7,2)DEPTNO NOT NULL NUMBER(2)TAX TableName Null? Type------------------------------- -------- ---------TAXGRADE NUMBERLOWSAL NUMBERHIGHSAL NUMBERYou want to create a report that displays the employee details along with the tax category of eachemployee. The tax category is determined by comparing the salary of the employee from the EMPtable to the lower and upper salary values in the TAX table.Which SELECT statement produces the required results?A. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary IN t.lowsal AND t.highsal;B. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary BETWEEN t.lowsal AND t.highsal;C. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary >= t.lowsal AND <= t.highsal;D. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary <= t.lowsal AND e.salary >= t.highsal;Answer: BQUESTION NO: 51Click 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 tables primary keycolumn. The sequence should begin at 1000, have a maximum value of 999999999, never reuseany numbers, and increment by 1.Which statement would you use to complete this task? "Pass Any Exam. Any Time." - Guaranteed 28
  28. 28. Oracle 1z0-001: Practice ExamA. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999STEP BY 1;B. This task cannot be accomplished.C. CREATE SEQUENCE patient_id_seqON patient (patient_id)MINVALUE 1000MAXVALUE 999999999INCREMENT BY 1NOCYCLE;D. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999NOCYCLE;Answer: DQUESTION NO: 52You attempt to query the database with this command:SELECT name, salaryFROM employeeWHERE salary =(SELECT salaryFROM employeeWHERE last_name = Wagner OR dept_no = 233);Why could this statement cause an error? "Pass Any Exam. Any Time." - Guaranteed 29
  29. 29. Oracle 1z0-001: Practice ExamA. A single row subquery is used with a multiple row comparison operator.B. A multiple row subquery is used with a single row comparison operator.C. Logical operators are not allowed in the WHERE clause.D. Subqueries are not allowed in the WHERE clause.Answer: BQUESTION NO: 53Which statement shows the view definition of the view EMP_VIEW that is created based on thetable EMP?A. SELECT textFROM user_viewsWHERE view_name = EMP_VIEW;B. DESCRIBE VIEW emp_viewC. SELECT view_textFROM my_viewsWHERE view_name = EMP_VIEW;D. DESCRIBE empE. SELECT view_textFROM TABLE empWHERE view_name = EMP_VIEW;Answer: AQUESTION NO: 54Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)A. The SELECT statement contains a GROUP BY clause.B. The SELECT statement returns more than one row.C. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.D. The SELECT statement does not return a row.E. The SELECT statement does not have a WHERE clause.Answer: B,DQUESTION NO: 55Examine the code: "Pass Any Exam. Any Time." - Guaranteed 30
  30. 30. Oracle 1z0-001: Practice Exam1 DECLARE2 i NUMBER := 0;3 v_date DATE;4 BEGIN5 i := i+1;6 LOOP7 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 canyou trace the values of the counter variable I and date variable V_DATE in the SQL*Plusenvironment?A. by inserting the statementDBMS_OUTPUT.PUT_LINE (i || || TO_CHAR(v_date));between lines 8 and 9B. by setting the SQL*Plus session variable DEBUGGER = TRUEC. by inserting the statementDBMS_OUTPUT.PUT_LINE (i, v_date);between lines 8 and 9D. by inserting the statementDBMS_OUTPUT.DEBUG_VAR (i, v_date);between lines 8 and 9Answer: AQUESTION NO: 56The PRODUCT table contains these columns:ID NUMBER(9) PKCOST 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 ofeach product is increased by 10% and the sale price of each product is increased by 25%.You issue this SQL statement:SELECT id, sale_price * 1.25 - cost * 1.10 "Pass Any Exam. Any Time." - Guaranteed 31
  31. 31. Oracle 1z0-001: Practice ExamFROM product;Which conclusion can you draw from the results?A. A function needs to be included in the SELECT statement to achieve the desired results.B. The order of the operations in the calculation needs to be changed to achieve the requiredresults.C. The results provide more information than management requested.D. Only the required results are displayed.Answer: DQUESTION NO: 57Which statement would you use to add a primary key constraint to the patient table using theid_number column, immediately enabling the constraint?A. ALTER TABLE patientADD (id_number CONSTRAINT pat_id_pk PRIMARY KEY);B. ALTER TABLE patientMODIFY (id_number CONSTRAINT pat_id_pk PRIMARY KEY);C. This task cannot be accomplished.D. ALTER TABLE patientADD CONSTRAINT pat_id_pk PRIMARY KEY(id_number);Answer: DQUESTION NO: 58You need to analyze how long your orders take to be shipped from the date that the order isplaced. To do this, you must create a report that displays the customer number, date ordered, dateshipped, and the number of months in whole numbers from the time the order is placed to the timethe order is shipped. Which statement produces the required results?A. SELECT custid, orderdate, shipdate,ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken"FROM ord;B. SELECT custid, orderdate, shipdate,ROUNDOFF(shipdate - orderdate) "Time Taken"FROM ord;C. SELECT custid, orderdate, shipdate,MONTHS_BETWEEN (shipdate, orderdate)"Time Taken" "Pass Any Exam. Any Time." - Guaranteed 32
  32. 32. Oracle 1z0-001: Practice ExamFROM ord;D. SELECT custid, orderdate, shipdate,ROUND(MONTHS_BETWEEN (shipdate, orderdate))"Time Taken"FROM ord;Answer: DQUESTION NO: 59In which situation should you use an outer join query?A. The employee table column corresponding to the region table column contains null values forrows 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: AQUESTION NO: 60Evaluate this IF statement:IF v_value > 100 THENv_new_value := 2 * v_value;ELSIF v_value > 200 THENv_new_value := 3 * v_value;ELSIF v_value < 300 THENv_new_value := 4 * v_value;ELSEv_new_value := 5 * v_value;END IF;What would be assigned to V_NEW_VALUE if V_VALUE is 250?A. 500B. 750C. 250D. 1000E. 1250 "Pass Any Exam. Any Time." - Guaranteed 33
  33. 33. Oracle 1z0-001: Practice ExamAnswer: AQUESTION NO: 61Evaluate this SQL script:CREATE ROLE manager;CREATE ROLE clerk;CREATE ROLE inventory;CREATE USER scott IDENTIFIED BY tiger;GRANT inventory TO clerk;GRANT clerk TO manager;GRANT inventory TO scott/How many roles will user SCOTT have access to?A. 3B. 1C. 0D. 2Answer: BQUESTION NO: 62Which is NOT an SQL*Plus command?A. DESCRIBEB. CHANGEC. LISTD. UPDATEE. ACCEPTAnswer: DQUESTION NO: 63You attempt to query the database with this command:SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) "Pass Any Exam. Any Time." - Guaranteed 34
  34. 34. Oracle 1z0-001: Practice ExamFROM employeeWHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60GROUP BY dept_noORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date));Why does this statement cause an error?A. A SELECT clause cannot contain a group function.B. An ORDER BY clause cannot contain a group function.C. A group function cannot contain a single row function.D. A WHERE clause cannot be used to restrict groups.Answer: DQUESTION NO: 64The EMPLOYEE table contains these columns:ID NUMBER(9)LAST_NAME VARCHAR2(25)FIRST_NAME VARCHAR2(25)COMMISSION NUMBER(7,2)You need to display the current commission for all employees.These are the desired results:1.Display the commission multiplied by 1.5.2.Exclude employees with a zero commission.3.Display a zero for employees with a null commission value.Evaluate this SQL command:SELECT id, last_name, first_name, commission * 1.5FROM employeeWHEREcommission <> 0;What does the statement provide?A. one of the desired resultsB. a syntax errorC. all of the desired resultsD. two of the desired results "Pass Any Exam. Any Time." - Guaranteed 35
  35. 35. Oracle 1z0-001: Practice ExamAnswer: DQUESTION NO: 65You issue this command:CREATE SYNONYM empFOR ed.employee;Which task has been accomplished?A. The need to qualify an object name with its schema was eliminated for all users.B. The need to qualify an object name with its schema was eliminated for user Ed.C. The need to qualify an object name with its schema was eliminated for only you.D. The need to qualify an object name with its schema was eliminated for users with access.Answer: CQUESTION NO: 66Evaluate this SQL script:CREATE ROLE manager;CREATE ROLE clerk;CREATE ROLE inventory;CREATE USER scott IDENTIFIED BY tiger;GRANT inventory TO clerk;GRANT clerk TO manager;GRANT inventory TO scott/How many roles will user SCOTT have access to?A. 2B. 3C. 0D. 1Answer: D "Pass Any Exam. Any Time." - Guaranteed 36
  36. 36. Oracle 1z0-001: Practice ExamQUESTION NO: 67Evaluate this PL/SQL block:BEGINFOR i IN 1..5 LOOPIF 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. 2B. 1C. 5D. 0E. 6F. 3Answer: BQUESTION NO: 68You need to store currency data and you know that the data will always have two digits to the rightof 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. LONGB. NUMBERC. LONG RAWD. NUMBER(p)Answer: BQUESTION NO: 69 "Pass Any Exam. Any Time." - Guaranteed 37
  37. 37. Oracle 1z0-001: Practice ExamExamine the structure of the STUDENT table:Name Null? Type------------- ----------------- -------------STUD_ID NOT NULL NUMBER(3)NAME VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATECurrently, the table is empty. You have decided that NULL values should not be allowed for NAMEcolumn.Which statement restricts NULL values from being entered into the column?A. ALTER TABLE studentADD CONSTRAINT name(NOT NULL);B. ALTER TABLE studentADD CONSTRAINT NOT NULL(name);C. ALTER TABLE studentMODIFY (name varchar2(25) NOT NULL);D. ALTER TABLE studentMODIFY CONSTRAINT name(NOT NULL);Answer: CQUESTION NO: 70Evaluate this PL/SQL block:BEGINFOR i IN 1..10 LOOPIF i = 4 OR i = 6 THENnull;ELSEINSERT INTO test(results)VALUES (I);END IF;COMMIT;END LOOP;ROLLBACK;END; "Pass Any Exam. Any Time." - Guaranteed 38
  38. 38. Oracle 1z0-001: Practice ExamHow many values will be inserted into the TEST table?A. 4B. 8C. 0D. 10E. 6Answer: BQUESTION NO: 71You attempt to create the salary table with this command:1.CREATE TABLE salary2.(employee_idNUMBER(9)3.CONSTRAINT salary_pk PRIMARY KEY,4.1995_salaryNUMBER(8,2),5.manager_nameVARCHAR2(25)6.CONSTRAINT mgr_name_nn NOT NULL,7.$salary_96NUMBER(8,2));Which two lines of this statement will return errors? (Choose two.)A. 4B. 5C. 7D. 3E. 2F. 1Answer: A,CQUESTION NO: 72Which 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 FROMclause.B. You eliminate the need to create a new view or table by placing a subquery in the FROMclause. "Pass Any Exam. Any Time." - Guaranteed 39
  39. 39. Oracle 1z0-001: Practice ExamC. You eliminate the need to grant SELECT privileges on the table used in the FROM clausesubquery.D. You cannot use a subquery in the FROM clause.Answer: BQUESTION NO: 73In which order does the Oracle Server evaluate clauses?A. WHERE, GROUP BY, HAVINGB. WHERE, HAVING, GROUP BYC. HAVING, WHERE, GROUP BYD. GROUP BY, HAVING, WHEREAnswer: AQUESTION NO: 74You need to change the job title Clerk to Administrative Clerk for all clerks. Which statementdoes this?A. UPDATE empSET VALUES job = Administrative ClerkWHERE UPPER(job) = CLERK;B. UPDATE empSET job = Administrative Clerk;C. UPDATE empjob := Administrative ClerkWHERE UPPER(job) = CLERK;D. UPDATE empSET job = Administrative ClerkWHERE UPPER(job) = CLERK;Answer: DQUESTION NO: 75Examine the structure of the STUDENT table:Name Null? Type----------------- ------------- ------------ "Pass Any Exam. Any Time." - Guaranteed 40
  40. 40. Oracle 1z0-001: Practice ExamSTUD_ID NOT NULL NUMBER(3)NAME VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATECurrently, the table is empty. You have decided that NULL values should not be allowed for NAMEcolumn.Which statement restricts NULL values from being entered into the column?A. ALTER TABLE studentMODIFY (name varchar2(25) NOT NULL);B. ALTER TABLE studentADD CONSTRAINT name(NOT NULL);C. ALTER TABLE studentADD CONSTRAINT NOT NULL(name);D. ALTER TABLE studentMODIFY CONSTRAINT name(NOT NULL);Answer: AQUESTION NO: 76Click on the EXHIBIT button and examine the table instance chart for the cars table.You query the database with this command:SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available"FROM carsWHERE model = FireGROUP BY lot_noHAVING COUNT(*) > 10ORDER BY COUNT(*);Which clause restricts which groups are displayed? "Pass Any Exam. Any Time." - Guaranteed 41
  41. 41. Oracle 1z0-001: Practice ExamA. HAVING COUNT(*) > 10B. WHERE model = FireC. GROUP BY lot_noD. ORDER BY COUNT(*)E. SELECT lot_no "Lot Number", COUNT(*) "Number of Cars Available"Answer: AQUESTION NO: 77Which privilege concerns system level security?A. DROP ANY TABLEB. INDEXC. DELETED. UPDATEE. ALTERAnswer: AQUESTION NO: 78Which statement is valid within the executable section of a PL/SQL block?A. WHEN NO_DATA_FOUND THENDBMS_OUTPUT.PUT_LINE (No records found);B. SELECT ename, salINTO v_ename, v_salFROM empWHERE empno = 101;C. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) ISBEGINIF n1 > n2 THEN "Pass Any Exam. Any Time." - Guaranteed 42
  42. 42. Oracle 1z0-001: Practice Examp_max := n1;ELSEp_max := n2;END;D. BEGINemp_rec emp%ROWTYPE;END;Answer: BQUESTION NO: 79A DBA has updated Smiths account by adding the privileges CREATE ANY TABLE and CREATEPROCEDURE. Which tasks can Smith successfully perform?A. Smith can create a table in any schema of the database but can drop tables from and createprocedures only in his schema.B. Smith can create any table or procedure only in his schema. Also, he can drop any table onlyfrom 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 atable in any schema of the database.Answer: AQUESTION NO: 80Which script would you use to query the data dictionary to view only the name of the primary keyconstraints by using a substitution parameter for the table name?A. ACCEPT table PROMPT Table to view primary key constraint: SELECT constraint_nameFROM user_constraintsWHERE table_name = UPPER(&table) AND constraint_type = PRIMARY;B. ACCEPT table PROMPT Table to view primary key constraint: SELECT constraint_nameFROM user_cons_columnsWHERE table_name = UPPER(&table) AND constraint_type = P;C. ACCEPT table PROMPT Table to view primary key constraint: SELECT constraint_name, constraint_typeFROM user_constraintsWHERE table_name = UPPER(&table); "Pass Any Exam. Any Time." - Guaranteed 43
  43. 43. Oracle 1z0-001: Practice ExamD. ACCEPT table PROMPT Table to view primary key constraint: SELECT constraint_nameFROM user_constraintsWHERE table_name = UPPER(&table) AND constraint_type = P;Answer: DQUESTION NO: 81The EMPLOYEE table contains these columns:ID NUMBER(9) PKLAST_NAME VARCHAR2(25)NNDEPT_ID NUMBER(9)Evaluate this SQL script:DEFINE id_2 = 93004SELECT *FROMemployeeWHEREid = (&id_2)/Which change should you make to the script so that it will execute?A. Remove the ampersand.B. Use the ACCEPT command.C. Add single quotation marks.D. No change is needed.Answer: DQUESTION NO: 82Which ALTER command would you use to reinstate a disabled primary key constraint?A. ALTER TABLE carsENABLE CONSTRAINT cars_id_pk;B. ALTER TABLE carsADD CONSTRAINT cars_id_pk PRIMARY KEY (id);C. ALTER TABLE carsENABLE PRIMARY KEY (id) CASCADE;D. ALTER TABLE carsENABLE PRIMARY KEY (id); "Pass Any Exam. Any Time." - Guaranteed 44
  44. 44. Oracle 1z0-001: Practice ExamAnswer: AQUESTION NO: 83You need to retrieve the employee names and salaries from your EMP table sorted by salary indescending order. If two names match for a salary, the names must be displayed in alphabeticalorder. Which statement produces the required results?A. SELECT ename, salFROM EMPORDER BY ename, sal;B. SELECT ename, salFROM EMPORDER BY sal DESC, ename ASCENDING;C. SELECT ename, salFROM EMPORDER BY sal, ename;D. SELECT ename, salFROM EMPORDER BY sal DESC, ename;E. SELECT ename, salFROM EMPSORT BY sal DESC, ename;Answer: DQUESTION NO: 84The EMPLOYEE table contains these columns:FIRST_NAMEVARCHAR2(25)COMMISSION NUMBER(3,2)Evaluate this SQL statement:SELECT first_name, commissionFROM employeeWHERE commission =(SELECTcommissionFROMemployeeWHEREUPPER(first_name) = SCOTT) "Pass Any Exam. Any Time." - Guaranteed 45
  45. 45. Oracle 1z0-001: Practice ExamWhat would cause this statement to fail?A. There is more than one employee with the first name Scott.B. The FIRST_NAME values in the database are in lowercase.C. Scott has a NULL commission value.D. Scott has a zero commission value.E. There is no employee with the first name Scott.Answer: AQUESTION NO: 85In SQL*Plus, you issued this command:DELETE FROM deptWHERE dept_id = 901;You received an integrity constraint error because a child record was found. What could you do tomake the statement execute?A. Add the CONSTRAINTS CASCADE option to the command.B. Add the FORCE keyword to the command.C. You cannot make the command execute.D. Delete the child records first.Answer: DQUESTION NO: 86You want to create a report to show different jobs in each department. You do not want to displayany duplicate rows in the report. Which SELECT statement do you use to create the report?A. SELECT deptno, jobFROM EMP;B. SELECT NODUPLICATE deptno, jobFROM EMP;C. SELECT DISTINCT deptno, jobFROM EMP;D. CREATE REPORTDISPLAY deptno, jobFROM EMP;E. SELECT DISTINCT deptno, DISTINCT jobFROM EMP; "Pass Any Exam. Any Time." - Guaranteed 46
  46. 46. Oracle 1z0-001: Practice ExamAnswer: CQUESTION NO: 87Which should you do after each FETCH statement in a PL/SQL block?A. Open the cursor.B. Initialize the loop.C. Close the cursor.D. Test for rows using a cursor attribute.Answer: DQUESTION NO: 88Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEEtables.Evaluate this SQL statement:CREATE INDEX emp_dept_id_idxON employee(dept_id);Which result will the statement provide?A. Increase the chance of full table scans.B. May reduce the amount of disk I/O for SELECT statements.C. May reduce the amount of disk I/O for INSERT statements.D. Store an index in the EMPLOYEE table.E. Override the unique index created when the FK relationship was defined.Answer: B "Pass Any Exam. Any Time." - Guaranteed 47
  47. 47. Oracle 1z0-001: Practice ExamQUESTION NO: 89Your company wants to give each employee a $100 salary increment. You need to evaluate theresults from the EMP table prior to the actual modification. If you do not want to store the results inthe database, which statement is valid?A. You need to give the arithmetic expression that involves the salary increment in the UPDATEclause of the SELECT statement.B. You need to give the arithmetic expression that involves the salary increment in the SET clauseof 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 SELECTclause of the SELECT statement.E. You need to give the arithmetic expression that involves the salary increment in the DISPLAYclause of the SELECT statement.Answer: DQUESTION NO: 90Click 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. Whatis the best way to modify the view to contain only those patients born in 1997?A. Replace the view adding a WHERE clause.B. Drop the patient_vu, then create a new view with a HAVING clause.C. Drop the patient_vu, then create a new view with a WHERE clause.D. Use the ALTER command to add a WHERE clause to verify the time.Answer: AQUESTION NO: 91 "Pass Any Exam. Any Time." - Guaranteed 48
  48. 48. Oracle 1z0-001: Practice ExamExamine the structure of the STUDENT table:Name Null? Type------------- ----------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATEGraduation column is a foreign key column to the GRADDATE table.Examine the data in the GRADDATE table:GRADUATION--------------20-JAN-199912-MAY-199919-JAN-200025-MAY-200013-JAN-200129-MAY-2001Which update statement produces the following error?ORA-02291: integrity constraint (SYS_C23) violated - parent key not foundA. UPDATE studentSET name = Smith,graduation = 29-MAY-2001WHERE stud_id = 101;B. UPDATE studentSET name = Smith,graduation = 15-AUG-2000WHERE stud_id = 101;C. UPDATE studentSET stud_id = 999,graduation = 29-MAY-2001WHERE stud_id = 101;D. UPDATE studentSET stud_id = NULL,address = 100 Main StreetWHERE graduation = 20-JAN-1999; "Pass Any Exam. Any Time." - Guaranteed 49
  49. 49. Oracle 1z0-001: Practice ExamAnswer: BQUESTION NO: 92Examine this block of code:SET SERVEROUTPUT ONDECLAREx NUMBER;v_sal NUMBER;v_found VARCHAR2(10) := TRUE;BEGINx := 1;v_sal := 1000;DECLAREv_found VARCHAR2(10);y NUMBER;BEGINIF (v_sal > 500) THENv_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 OFFWhy does this code produce an error when executed?A. The value of V_FOUND cannot be YES.B. Variable Y is declared in the inner block and referenced in the outer block.C. Variable V_FOUND is declared at more than one location.D. Variable V_SAL is declared in the outer block and referenced in the inner block.Answer: BQUESTION NO: 93 "Pass Any Exam. Any Time." - Guaranteed 50
  50. 50. Oracle 1z0-001: Practice ExamClick on the EXHIBIT button and examine the table instance chart for the employee table.You want to display each employees hire date from earliest to latest. Which SQL statement wouldyou use?A. SELECT hire_dateFROM employee;B. SELECT hire_dateFROM employeeORDER BY hire_date DESC;C. SELECT hire_dateFROM employeeORDER BY hire_date;D. SELECT hire_dateFROM employeeGROUP BY hire_date;Answer: CQUESTION NO: 94In which section of a PL/SQL block is a user-defined exception raised?A. headingB. declarativeC. executableD. exception handlingAnswer: CQUESTION NO: 95Examine the declaration section: "Pass Any Exam. Any Time." - Guaranteed 51
  51. 51. Oracle 1z0-001: Practice ExamDECLARECURSOR emp_cursor(p_deptno NUMBER, p_job VARCHAR2)ISSELECT empno, enameFROM empWHERE deptno = p_deptnoAND job = p_job;BEGIN...Which statement opens this cursor successfully?A. OPEN emp_cursor(Clerk, 10);B. OPEN emp_cursor;C. OPEN emp_cursor(p_deptno, p_job);D. OPEN emp_cursor(10,Analyst);Answer: DQUESTION NO: 96The EMPLOYEE table has ten columns. Since you often query the table with conditions based onfour or more columns, you created an index on all the columns in the table. Which result willoccur?A. The speed of inserts will be increased.B. Updates on the table will be slower.C. The size of the EMPLOYEE table will be increased.D. All queries on the table will be faster.Answer: BQUESTION NO: 97Which SELECT statement would you use in a PL/SQL block to query the employee table andretrieve the last name and salary of the employee whose id is 3?A. SELECT last_name, salaryINTO v_last_name, v_salaryFROM employeeWHERE id = 3; "Pass Any Exam. Any Time." - Guaranteed 52
  52. 52. Oracle 1z0-001: Practice ExamB. SELECT last_name, salaryFROM employeeINTO v_last_name, v_salaryWHERE id = 3;C. SELECT last_name, salaryFROM employeeWHERE id = 3;D. SELECT last_name, salaryFROM employee;Answer: AQUESTION NO: 98Examine the table structures:EMP Table Name Null? Type------------------------------- ----------------- -----------EMPNO NOT NULL NUMBER(4)NAME VARCHAR2(10)JOB VARCHAR2(9)MGR NUMBER(4)HIREDATE DATESALARY NUMBER(7,2)COMM NUMBER(7,2)DEPTNO NOT NULL NUMBER(2)TAX TableName Null? Type------------------------------- ---------- --------TAXGRADE NUMBERLOWSAL NUMBERHIGHSAL NUMBERYou want to create a report that displays the employee details along with the tax category of eachemployee. The tax category is determined by comparing the salary of the employee from the EMPtable to the lower and upper salary values in the TAX table.Which SELECT statement produces the required results?A. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax t "Pass Any Exam. Any Time." - Guaranteed 53
  53. 53. Oracle 1z0-001: Practice ExamWHERE e.salary BETWEEN t.lowsal AND t.highsal;B. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary <= t.lowsal AND e.salary >= t.highsal;C. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary IN t.lowsal AND t.highsal;D. SELECT e.name, e.salary, t.taxgradeFROM emp e, tax tWHERE e.salary >= t.lowsal AND <= t.highsal;Answer: AQUESTION NO: 99Click on the EXHIBIT button and examine the structure of the DEPARTMENT and EMPLOYEEtables.Evaluate this SQL statement:CREATE INDEX emp_dept_id_idxON employee(dept_id);Which result will the statement provide?A. May reduce the amount of disk I/O for SELECT statements.B. May reduce the amount of disk I/O for INSERT statements.C. Increase the chance of full table scans.D. Store an index in the EMPLOYEE table.E. Override the unique index created when the FK relationship was defined.Answer: A "Pass Any Exam. Any Time." - Guaranteed 54
  54. 54. Oracle 1z0-001: Practice ExamQUESTION NO: 100You attempt to create the salary table with this command:1.CREATE TABLE salary2.(employee_idNUMBER(9)3.CONSTRAINT salary_pk PRIMARY KEY,4.1995_salaryNUMBER(8,2),5.manager_nameVARCHAR2(25)6.CONSTRAINT mgr_name_nn NOT NULL,7.$salary_96NUMBER(8,2));Which two lines of this statement will return errors? (Choose two.)A. 3B. 2C. 1D. 7E. 4F. 5Answer: D,EQUESTION NO: 101Click 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 modelentered at the prompt, regardless of case?A. SELECT style, color, lot_noFROM carsWHERE model = &model; "Pass Any Exam. Any Time." - Guaranteed 55
  55. 55. Oracle 1z0-001: Practice ExamB. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = &model;C. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = UPPER(&model);D. SELECT style, color, lot_noFROM carsWHERE model = UPPER(&model);Answer: CQUESTION NO: 102Examine the structure of the STUDENT table:Name Null? Type---------------- -------- ------------STUD_ID NOT NULL NUMBER(3)NAME NOT NULL VARCHAR2(25)ADDRESS VARCHAR2(50)GRADUATION DATEWhich statement inserts a new row into the STUDENT table?A. INSERT INTO studentVALUES (101,Smith);B. INSERT INTO student (stud_id, address, graduation)VALUES (101,100 Main Street,17-JUN-99);C. INSERT INTO student (stud_id, address, name, graduation)VALUES (101,100 Main Street,Smith,17-JUN-99);D. INSERT INTO student tableVALUES (101,Smith,100 Main Street,17-JUN-99);E. INSERT INTO studentVALUES (101,100 Main Street,17-JUN-99,Smith);Answer: CQUESTION NO: 103You need to store currency data and you know that the data will always have two digits to the rightof the decimal point. However, the number of digits to the left of the decimal place will vary greatly. "Pass Any Exam. Any Time." - Guaranteed 56
  56. 56. Oracle 1z0-001: Practice ExamWhich datatype would be most appropriate to store this data?A. LONGB. LONG RAWC. NUMBER(p)D. NUMBERAnswer: DQUESTION NO: 104You need to remove all the data from the employee table while leaving the table definition intact.You want to be able to undo this operation. How would you accomplish this task?A. TRUNCATE TABLE employee;B. DELETE FROM employee;C. This task cannot be accomplished.D. DROP TABLE employee;Answer: BQUESTION NO: 105Click on the EXHIBIT button and examine the employee table.You create a view with this command:CREATE VIEW dept_salary_vuAS SELECT dept_no, salary, last_nameFROM employeeWHERE salary > 45000WITH CHECK OPTION;For which employee can you update the dept_no column? "Pass Any Exam. Any Time." - Guaranteed 57
  57. 57. Oracle 1z0-001: Practice ExamA. SouthallB. noneC. ChiazzaD. BrownAnswer: CQUESTION NO: 106The PLAYER table contains these columns:ID NUMBER(9)NAME VARCHAR(2)MANAGER_ID NUMBER(9)In this instance, managers are players and you need to display a list of players.Evaluate these two SQL statements:SELECT p.name, m.nameFROMplayer p, player mWHEREm.id = p.manager_id;SELECT p.name, m.nameFROMplayer p, player mWHEREm.manager_id = p.id;How will the results differ?A. Statement 1 will not execute; statement 2 will. "Pass Any Exam. Any Time." - Guaranteed 58
  58. 58. Oracle 1z0-001: Practice ExamB. Statement 1 is self-join; statement 2 is not.C. Statement 1 will execute; statement 2 will not.D. The results will be the same, but the display will be different.Answer: DQUESTION NO: 107You attempt to query the database with this command:SELECT dept_no, AVG(MONTHS_BETWEEN(SYSDATE, hire_date))FROM employeeWHERE AVG(MONTHS_BETWEEN(SYSDATE, hire_date)) > 60GROUP BY dept_noORDER BY AVG(MONTHS_BETWEEN(SYSDATE, hire_date));Why does this statement cause an error?A. A SELECT clause cannot contain a group function.B. An ORDER BY clause cannot contain a group function.C. A group function cannot contain a single row function.D. A WHERE clause cannot be used to restrict groups.Answer: DQUESTION NO: 108Evaluate this PL/SQL block:DECLAREv_result NUMBER(2);BEGINDELETEFROM employeeWHERE dept_id IN (10, 20, 30);v_result := SQL%ROWCOUNT;COMMIT;END;What will be the value of V_RESULT if no rows are deleted? "Pass Any Exam. Any Time." - Guaranteed 59
  59. 59. Oracle 1z0-001: Practice ExamA. 0B. NULLC. FALSED. 1E. TRUEAnswer: AQUESTION NO: 109Which two conditions in a PL/SQL block cause an exception to occur? (Choose two.)A. The SELECT statement does not have a WHERE clause.B. The SELECT statement contains a GROUP BY clause.C. The SELECT statement does not return a row.D. The SELECT statement returns more than one row.E. The datatypes in the SELECT list are inconsistent with the datatypes in the INTO clause.Answer: C,DQUESTION NO: 110The structure of the DEPT table is as follows:Name Null? Type------------------------------- -------------- ---------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)Examine the code:DECLAREdept_rec dept%ROWTYPE;BEGINSELECT *INTO dept_recFROM deptWHERE deptno = 10;END;Which PL/SQL statement displays the location of the selected department? "Pass Any Exam. Any Time." - Guaranteed 60
  60. 60. Oracle 1z0-001: Practice ExamA. 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 thedeclarative section.D. DBMS_OUTPUT.PUT_LINE (dept_rec(1).loc);Answer: AQUESTION NO: 111Which SELECT statement displays employee names, salaries, department numbers, and averagesalaries 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 outerGROUP BY outer.ename, outer.sal, outer.deptnoHAVING AVG(outer.sal) IN(SELECT inner.salFROM emp innerWHERE inner.deptno = outer.deptno);B. SELECT outer.ename,outer.sal,outer.deptno,AVG(outer.sal)FROM emp outerGROUP BY outer.ename, outer.sal, outer.deptnoHAVING AVG(outer.sal) >(SELECT inner.salFROM emp inner WHERE inner.deptno = outer.deptno);C. SELECT ename, sal, deptno, AVG(sal)FROM empGROUP BY ename, sal, deptno;D. SELECT a.ename, a.sal, a.deptno, b.salavgFROM emp a, (SELECT deptno, AVG(sal) salavgFROM empGROUP BY deptno) bWHERE a.deptno = b.deptnoAND a.sal > b.salavg;Answer: DQUESTION NO: 112 "Pass Any Exam. Any Time." - Guaranteed 61
  61. 61. Oracle 1z0-001: Practice ExamYou need to execute a script file named QUERYEMP.SQL from your SQL*Plus environment.Which command do you use?A. START QUERYEMPB. RUN QUERYEMPC. GET QUERYEMPD. EXECUTE QUERYEMPAnswer: AQUESTION NO: 113You need to create a PL/SQL program to insert records into the employee table. Which block ofcode successfully uses the INSERT command?A. DECLAREv_hiredate DATE := SYSDATE;BEGININSERT INTO emp(empno, ename, hiredate, deptno)(empno_sequence.nextval, &name, v_hiredate,&deptno);END;B. DECLAREv_hiredate DATE := SYSDATE;BEGININSERT INTO emp(empno, ename, hiredate, deptno)VALUES(empno_sequence.nextval, &name, v_hiredate,&deptno);END;C. DECLAREv_hiredate DATE := SYSDATE;BEGININSERT INTO emp(empno, ename, hiredate, deptno)VALUES(empno_sequence.nextval, &name, v_hiredate,&deptno)WHERE job = CLERK;END;D. DECLAREv_hiredate DATE := SYSDATE;BEGININSERT INTO emp(empno, ename, hiredate)VALUES(empno_sequence.nextval, &name, v_hiredate, "Pass Any Exam. Any Time." - Guaranteed 62
  62. 62. Oracle 1z0-001: Practice Exam&deptno);END;Answer: BQUESTION NO: 114Which SELECT statement displays the order id, product id, and quantity of items in the ITEM tablethat match both the product id and quantity of an item in order 605? (Do not display the details fororder 605.)A. SELECT ordid, prodid, qtyFROM itemWHERE (prodid, qty) IN(SELECT prodid, qtyFROM itemWHERE ordid = 605)AND ordid <> 605;B. SELECT ordid, prodid, qtyFROM itemWHERE (prodid, qty) =(SELECT prodid, qtyFROM itemWHERE ordid = 605)AND ordid <> 605;C. SELECT ordid, prodid, qtyFROM itemWHERE (prodid, qty) IN(SELECT prodid, qtyFROM itemWHERE ordid = 605);D. SELECT ordid, prodid, qtyFROM itemWHERE (prodid, qty) IN(SELECT ordid, prodid, qtyFROM itemWHERE ordid = 605)AND ordid <> 605;Answer: A "Pass Any Exam. Any Time." - Guaranteed 63
  63. 63. Oracle 1z0-001: Practice ExamQUESTION NO: 115Evaluate this PL/SQL block:BEGINFOR i IN 1..10 LOOPIF i = 4 OR i = 6 THENnull;ELSEINSERT INTO test(results)VALUES (I);END IF;COMMIT;END LOOP;ROLLBACK;END;How many values will be inserted into the TEST table?A. 8B. 10C. 4D. 6E. 0Answer: AQUESTION NO: 116You create the sale table with this command:CREATE TABLE sale(purchase_no NUMBER(9)CONSTRAINT sale_purchase_no_pk PRIMARY KEY,customer_id NUMBER(9)CONSTRAINT sale_customer_id_fk REFERENCES customer (id)CONSTRAINT sale_customer_id_nn NOT NULL);Which index or indexes are created for this table?A. No indexes are created for this table. "Pass Any Exam. Any Time." - Guaranteed 64
  64. 64. Oracle 1z0-001: Practice ExamB. An index is created for each column.C. An index is created for the customer_id column.D. An index is created for the purchase_no column.Answer: DQUESTION NO: 117Click 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 tables primary key column.The sequence begins at 1000, has a maximum value of 999999999, and increments by 1. Youneed to write a script to insert a row into the patient table and use the sequence you created.Which script would you use to complete this task?A. INSERT INTO patient (id_number, last_name, first_name, birth_date)VALUES (patient_id_seq, last_name, first_name, birth_date)/B. INSERT INTO patient (id_number, last_name, first_name, birth_date)VALUES (patient_id_seq.NEXTVAL, &last_name, &first_name, &birth_date)/C. INSERT INTO patient (id_number, last_name, first_name, birth_date)VALUES (patient_id_seq.NEXTVALUE, &last_name, &first_name, &birth_date)/D. INSERT INTO patient (id_number)VALUES (patient_id_seq.NEXTVALUE)/E. This task cannot be accomplished.F. INSERT INTO patient (id_number, last_name, first_name, birth_date)VALUES (patient_id_seq.CURRVAL, &last_name, &first_name, &birth_date)/Answer: B "Pass Any Exam. Any Time." - Guaranteed 65
  65. 65. Oracle 1z0-001: Practice ExamQUESTION NO: 118How do you send the output of your SQL*Plus session to a text operating system file calledMYOUTPUT.LST?A. SAVE myoutput.lstB. SPOOL myoutput.lstC. PRINT myoutput.lstD. SENDOUTPUT myoutput.lstAnswer: BQUESTION NO: 119You need to analyze how long your orders take to be shipped from the date that the order isplaced. To do this, you must create a report that displays the customer number, date ordered, dateshipped, and the number of months in whole numbers from the time the order is placed to the timethe order is shipped.Which statement produces the required results?A. SELECT custid, orderdate, shipdate,ROUNDOFF(shipdate - orderdate) "Time Taken"FROM ord;B. SELECT custid, orderdate, shipdate,MONTHS_BETWEEN (shipdate, orderdate)"Time Taken"FROM ord;C. SELECT custid, orderdate, shipdate,ROUND(DAYS_BETWEEN (shipdate, orderdate))/ 30) "Time Taken"FROM ord;D. SELECT custid, orderdate, shipdate,ROUND(MONTHS_BETWEEN (shipdate, orderdate))"Time Taken"FROM ord;Answer: DQUESTION NO: 120The EMPLOYEE table contains these columns:BONUSNUMBER(7,2) "Pass Any Exam. Any Time." - Guaranteed 66
  66. 66. Oracle 1z0-001: Practice ExamDEPT_ID NUMBER(9)There are 10 departments and each department has at least 1 employee. Bonus values aregreater than 500; not all employees receive a bonus.Evaluate this PL/SQL block:DECLAREv_bonusemployee.bonus%TYPE := 300;BEGINUPDATE employeeSET bonus = bonus + v_bonusWHERE dept_id IN (10, 20, 30);COMMIT;END;What will be the result?A. A subset of employees will be given a 300 bonus.B. All employees will be given a 300 increase in bonus.C. A subset of employees will be given a 300 increase in bonus.D. All employees will be given a 300 bonus.Answer: CQUESTION NO: 121The view EMP_VIEW is created based on the table EMP as follows:CREATE OR REPLACE VIEW emp_viewASSELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMPFROM empGROUP BY deptno;What happens when the following command is issued?UPDATE emp_viewSET tot_sal = 20000WHERE deptno = 10;A. The base table can not be updated through this view. "Pass Any Exam. Any Time." - Guaranteed 67
  67. 67. Oracle 1z0-001: Practice ExamB. 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: AQUESTION NO: 122In which order does the Oracle Server evaluate clauses?A. WHERE, HAVING, GROUP BYB. HAVING, WHERE, GROUP BYC. WHERE, GROUP BY, HAVINGD. GROUP BY, HAVING, WHEREAnswer: CQUESTION NO: 123Click 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 modelentered at the prompt, regardless of case?A. SELECT style, color, lot_noFROM carsWHERE model = UPPER(&model);B. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = &model;C. SELECT style, color, lot_noFROM carsWHERE model = &model; "Pass Any Exam. Any Time." - Guaranteed 68
  68. 68. Oracle 1z0-001: Practice ExamD. SELECT style, color, lot_noFROM carsWHERE UPPER(model) = UPPER(&model);Answer: DQUESTION NO: 124Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.You issue this SQL statement:SELECT pr.nameFROMpart pt, product prWHEREpt.product_id(+) = pr.id;What is the result?A. A list of all products is displayed for products with parts.B. An error is generated.C. A list of all product names is displayed.D. A list of products is displayed for parts that have products assigned.Answer: CQUESTION NO: 125The structure of the DEPT table is as follows:Name Null? Type------------------------------- ---------- --------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)Examine the declaration section: "Pass Any Exam. Any Time." - Guaranteed 69
  69. 69. Oracle 1z0-001: Practice ExamDECLARETYPE dept_table_type IS TABLE OF dept%ROWTYPEINDEX 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 statementmakes 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: BQUESTION NO: 126Evaluate these two SQL commands:1.SELECT DISTINCT object_typeFROM user_objects;2.SELECTobject_typeFROM all_objects;How will the results differ?A. Statement 1 will display the distinct object types owned by the user; statement 2 will display allthe object types the user can access.B. Statement 1 will display the distinct object types owned by the user; statement 2 will display allthe object types in the database.C. Statement 1 will display the distinct object types in the database; statement 2 will display all theobject types in the database.D. Statement 1 will display the distinct object types that the user can access; statement 2 willdisplay all the object types that the user owns.Answer: AQUESTION NO: 127Which statement is valid within the executable section of a PL/SQL block? "Pass Any Exam. Any Time." - Guaranteed 70
  70. 70. Oracle 1z0-001: Practice ExamA. PROCEDURE calc_max (n1 NUMBER,n2 NUMBER,p_max OUT NUMBER) ISBEGINIF n1 > n2 THENp_max := n1;ELSEp_max := n2;END;B. SELECT ename, salINTO v_ename, v_salFROM empWHERE empno = 101;C. WHEN NO_DATA_FOUND THENDBMS_OUTPUT.PUT_LINE (No records found);D. BEGINemp_rec emp%ROWTYPE;END;Answer: BQUESTION NO: 128You want to create a report that gives, per department, the number of employees and total salaryas a percentage of all the departments.Examine the results from the report:Department %Employees %Salary--------------- ---------------- -------------10 21.43 30.15 20 35.71 37.4730 42.86 32.39Which SELECT statement produces the report?A. SELECT deptno "Department",(COUNT(*)/COUNT(empno)) * 100 "%Employees",(SUM(sal)/COUNT(*)) * 100 "%Salary"FROM scott.empGROUP BY deptno;B. SELECTa.deptno "Department",ROUND(a.num_emp/b.total_count * 100, 2) "%Employees", "Pass Any Exam. Any Time." - Guaranteed 71
  71. 71. Oracle 1z0-001: Practice ExamROUND(a.sal_sum/b.total_sal * 100, 2) "%Salary"FROM(SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sumFROM scott.empGROUP BY deptno) a,(SELECT COUNT(*) total_count, SUM(sal) total_salFROM scott.emp) b;C. SELECT deptno "Department",PCT(empno) "%Employees",PCT(sal) "%Salary"FROM scott.empGROUP BY deptno;D. SELECT a.deptno "Department",(a.num_emp/COUNT(*)) * 100 "%Employees",(a.sal_sum/COUNT(*)) * 100 "%Salary"FROM(SELECT deptno, COUNT(*) num_emp, SUM(SAL) sal_sumFROM scott.empGROUP BY deptno) a;Answer: BQUESTION NO: 129Which privilege concerns system level security?A. INDEXB. DROP ANY TABLEC. DELETED. UPDATEE. ALTERAnswer: BQUESTION NO: 130The view EMP_VIEW is created based on the table EMP as follows:CREATE OR REPLACE VIEW emp_viewASSELECT deptno, SUM(sal) TOT_SAL, COUNT(*) NUM_EMPFROM emp "Pass Any Exam. Any Time." - Guaranteed 72
  72. 72. Oracle 1z0-001: Practice ExamGROUP BY deptno;What happens when the following command is issued?UPDATE emp_viewSET tot_sal = 20000WHERE 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: DQUESTION NO: 131Click 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 tables primary keycolumn. The sequence should begin at 1000, have a maximum value of 999999999, never reuseany numbers, and increment by 1.Which statement would you use to complete this task?A. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999STEP BY 1;B. This task cannot be accomplished.C. CREATE SEQUENCE patient_id_seqON patient (patient_id)MINVALUE 1000MAXVALUE 999999999INCREMENT BY 1 "Pass Any Exam. Any Time." - Guaranteed 73
  73. 73. Oracle 1z0-001: Practice ExamNOCYCLE;D. CREATE SEQUENCE patient_id_seqSTART WITH 1000MAXVALUE 999999999NOCYCLE;Answer: DQUESTION NO: 132For which three tasks would you use the WHERE clause? (Choose three.)A. restrict the rows displayedB. display only data greater than a specified valueC. restrict the output of a group functionD. designate a table locationE. display only unique dataF. compare two valuesAnswer: A,B,FQUESTION NO: 133You have a view called ANN_SAL that is based on the EMPLOYEE table. The structure of theANN_SAL view is:Name Null? Type------------------------------- -------------- ----------EMPNO NOT NULL NUMBER(4)YEARLY_SAL NUMBER(9,2)MONTHLY_SAL NUMBER(9,2)Which statement retrieves data from the ANN_SAL view?A. SELECT *FROM VIEW ann_sal BASEDON employee;B. SELECT *FROM EMPLOYEE;C. SELECT *FROM ann_sal;D. SELECT *FROM VIEW ann_sal; "Pass Any Exam. Any Time." - Guaranteed 74
  74. 74. Oracle 1z0-001: Practice ExamAnswer: CQUESTION NO: 134The PLAYER table contains these columns:ID NUMBER(9)NAME VARCHAR(2)MANAGER_ID NUMBER(9)In this instance, managers are players and you need to display a list of players.Evaluate these two SQL statements:SELECT p.name, m.nameFROMplayer p, player mWHEREm.id = p.manager_id;SELECT p.name, m.nameFROMplayer p, player mWHEREm.manager_id = p.id;How will the results differ?A. The results will be the same, but the display will be different.B. Statement 1 will execute; statement 2 will not.C. Statement 1 will not execute; statement 2 will.D. Statement 1 is self-join; statement 2 is not.Answer: AQUESTION NO: 135Click on the EXHIBIT button and examine the structure of the PRODUCT and PART tables.You issue this SQL statement:SELECT pr.nameFROMpart pt, product prWHEREpt.product_id(+) = pr.id;What is the result? "Pass Any Exam. Any Time." - Guaranteed 75
  75. 75. Oracle 1z0-001: Practice ExamA. A list of products is displayed for parts that have products assigned.B. A list of all product names is displayed.C. A list of all products is displayed for products with parts.D. An error is generated.Answer: BQUESTION NO: 136Which statement is true about nesting blocks?A. A variable defined in the inner block is visible in the outer blocks.B. A variable defined in the outer block is visible in the inner blocks.C. Variable names must be unique between blocks.D. A variable in an inner block may have the same name as a variable in an outer block only if thedata types are different.Answer: BQUESTION NO: 137Which statement about multiple column subqueries is true?A. A pairwise comparison produces a cross product.B. In a pairwise subquery, the values returned from the subquery are compared individually to thevalues in the outer query.C. In a non-pairwise subquery, the values returned from the subquery are compared as a group tothe values in the outer query.D. A non-pairwise comparison produces a cross product.Answer: DQUESTION NO: 138Examine the code: "Pass Any Exam. Any Time." - Guaranteed 76
  76. 76. Oracle 1z0-001: Practice ExamSET SERVEROUTPUT ONDECLAREv_char_val VARCHAR2(100);BEGINv_char_val := Hello World;DBMS_OUTPUT.PUT_LINE(v_char_val);END;SET SERVEROUTPUT OFFThis code is stored in a script file named myproc.sql. Which statement executes the code in thescript file?A. EXECUTE myproc.sqlB. RUN myproc.sqlC. BEGIN myproc.sql END;D. myproc.sqlE. START myproc.sqlAnswer: EQUESTION NO: 139You want to display the average salary for departments 20 and 50, but only if those departmentshave an average salary of at least 2000. Which statement will produce the required results?A. SELECT deptno, AVG(sal)FROM empGROUP BY deptnoHAVING AVG(sal) >= 2000AND deptno IN (20, 50);B. SELECT deptno, AVG(sal)FROM empWHERE deptno IN (20, 50)GROUP BY deptnoHAVING AVG(sal) >= 2000;C. SELECT deptno, AVG(sal)FROM empWHERE deptno IN (20, 50)GROUP BY AVG(sal)HAVING AVG(sal) >= 2000;D. SELECT deptno, AVG(sal)FROM emp "Pass Any Exam. Any Time." - Guaranteed 77
  77. 77. Oracle 1z0-001: Practice ExamWHERE deptno IN (20, 50)AND AVG(sal) >= 2000GROUP BY deptno;Answer: BQUESTION NO: 140Click on the EXHIBIT button and examine the employee table.You attempt to query the database with this command:SELECT dept_no, last_name, SUM(salary)FROM employeeWHERE salary < 50000GROUP BY dept_noORDER BY last_name;Which clause causes an error?A. WHERE salary < 50000B. FROM employeeC. ORDER BY last_nameD. GROUP BY dept_noAnswer: DQUESTION NO: 141 "Pass Any Exam. Any Time." - Guaranteed 78
  78. 78. Oracle 1z0-001: Practice ExamGiven this CURSOR statement:DECLARECURSOR query_cursor (v_salary) ISSELECT last_name, salary, dept_noFROM employeeWHERE salary > v_salary;Why does this statement cause an error?A. A scalar datatype was not specified for the parameter.B. A WHERE clause is not allowed in a CURSOR statement.C. The INTO clause is missing from the SELECT statement.D. The parameter mode was not defined.Answer: AQUESTION NO: 142Which three SQL arithmetic expressions return a date? (Choose three.)A. (03-JUL-96 - 04-JUL-97) / 7B. (03-JUL-96 - 04-JUL-97) / 12C. 03-JUL-96 + (12 / 24)D. 03-JUL-96 - 04-JUL-97E. 03-JUL-96 + 7F. 03-JUL-96 - 12Answer: C,E,FQUESTION NO: 143When selecting data, which statement is valid about projection?A. Projection allows you to choose columns.B. Projection allows you to choose rows.C. Projection allows you to join tables together.D. Projection allows you to add columns to a table.Answer: A "Pass Any Exam. Any Time." - Guaranteed 79
  79. 79. Oracle 1z0-001: Practice ExamQUESTION NO: 144Which statement describes the use of a group function?A. A group function produces one result from many rows per group.B. A group function produces one result from each row of the table.C. A group function produces a group of results from one row.D. A group function produces many results from many rows per group.Answer: AQUESTION NO: 145Which 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. LONGC. NUMBERAnswer: CQUESTION NO: 146The structure of the DEPT table is as follows:Name Null? Type------------------------------- -------- -------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)Examine the code:DECLARETYPE dept_record_type IS RECORD(dno NUMBER,name VARCHAR2(20));dept_rec dept_record_type;BEGINSELECT deptno, dnameINTO dept_rec "Pass Any Exam. Any Time." - Guaranteed 80
  80. 80. Oracle 1z0-001: Practice ExamFROM deptWHERE deptno = 10;END;Which statement displays the name of the selected department?A. DBMS_OUTPUT.PUT_LINE(dept_rec.name);B. DBMS_OUTPUT.PUT_LINE(dname);C. DBMS_OUTPUT.PUT_LINE(dept_rec.dname);D. DBMS_OUTPUT.PUT_LINE(name);E. DBMS_OUTPUT.PUT_LINE(dept_rec(name));Answer: AQUESTION NO: 147You need to create a report to display the ship date and order totals of your ORDER table. If theorder 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 adatatype of NUMBER.Which statement do you use to create this report?A. SELECT ordid, NVL(shipdate, Not Shipped),NVL(total,Not Available)FROM order;B. SELECT ordid, shipdate "Not Shipped",total "Not Available"FROM order;C. SELECT ordid, NVL(TO_CHAR(shipdate), Not Shipped),NVL(TO_CHAR(total),Not Available)FROM order;D. SELECT ordid,TO_CHAR(shipdate, Not Shipped),TO_CHAR(total,Not Available)FROM order;Answer: CQUESTION NO: 148 "Pass Any Exam. Any Time." - Guaranteed 81
  81. 81. Oracle 1z0-001: Practice ExamExamine the code:SELECT employee.enameFROM emp employeeWHERE employee.empno NOT IN(SELECT manager.mgrFROM emp manager);What is the NOT IN operator equivalent to, in the above query?A. ALLB. !=ALLC. NOT LIKED. !=Answer: BQUESTION NO: 149The PART table contains these columns:ID NUMBER(7) PKCOST NUMBER(7,2)PRODUCT_ID NUMBER(7)Evaluate these two SQL statements:1.SELECT ROUND(MAX(cost),2),ROUND(MIN(cost),2),ROUND(SUM(cost),2),ROUND(AVG(cost),2)FROM part;2.SELECT product_id, ROUND(MAX(cost),2),ROUND(MIN(cost),2),ROUND(SUM(cost),2),ROUND(AVG(cost),2)FROM partGROUP BY product_id;How will the results differ?A. Statement 1 will only display one row of results; statement 2 could display more than one. "Pass Any Exam. Any Time." - Guaranteed 82
  82. 82. Oracle 1z0-001: Practice ExamB. The results will be the same, but the display will differ.C. Statement 1 will display a result for each part; statement 2 will display a result for each product.D. One of the statements will generate an error.Answer: AQUESTION NO: 150Which table name is valid?A. invoices-1996B. catch_#22C. 1996_invoicesD. numberE. #_667Answer: BQUESTION NO: 151In which section of a PL/SQL block is a user-defined exception raised?A. headingB. declarativeC. exception handlingD. executableAnswer: DQUESTION NO: 152You need to perform a major update on the EMPLOYEE table. You have decided to disable thePRIMARY KEY constraint on the empid column and the CHECK constraint on the job column.What happens when you try to enable the constraints after the update is completed?A. You need to recreate the constraints once they are disabled.B. The indexes on both the columns with the PRIMARY KEY constraint and the CHECK constraintare 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 messageis generated if any existing values do not confirm. "Pass Any Exam. Any Time." - Guaranteed 83
  83. 83. Oracle 1z0-001: Practice ExamE. Only the future values are verified to confirm with the constraints, leaving the existing valuesunchecked.Answer: DQUESTION NO: 153The structure of the DEPT table is as follows:Name Null? Type------------------------------- ------------ --------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)Examine the declaration section:DECLARETYPE 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.locFROM deptWHERE deptno = 10;B. You can not retrieve the entire row using the DEPT_REC variable declared in the code.C. SELECT deptno, dname, locINTO dept_recFROM deptWHERE deptno = 10;D. SELECT *INTO dept_recFROM deptWHERE deptno = 10;Answer: B "Pass Any Exam. Any Time." - Guaranteed 84
  84. 84. Oracle 1z0-001: Practice ExamQUESTION NO: 154You need to update employee salaries. If the salary of an employee is less than 1000, the salaryneeds to be incremented by 10%.Use a SQL*Plus substitution variable to accept the employee number.Which PL/SQL block successfully updates the salaries?A. DECLAREv_sal emp.sal%TYPE;BEGINSELECT salINTO v_salFROM empWHERE empno = &&p_empno;IF (v_sal < 1000) THENUPDATE empINTO sal := sal * 1.1WHERE empno = &p_empno;END IF;END;B. DECLAREv_sal emp.sal%TYPE;BEGINSELECT salINTO v_salFROM empWHERE empno = &&p_empno;IF (v_sal < 1000) THENUPDATE empSET sal = sal * 1.1WHERE empno = &p_empno;END IF;END;C. DECLAREv_sal emp.sal%TYPE;BEGINSELECT salINTO v_salFROM empWHERE empno = &&p_empno; "Pass Any Exam. Any Time." - Guaranteed 85

×