Oracle Mock Final

18 Questions

Settings
Please wait...
Oracle Quizzes & Trivia

Questions and Answers
  • 1. 
    You need to remove database trigger BUSINESS_RULE. Which command do you use to remove the trigger in the SQL*Plus environment?
    • A. 

      DROP TRIGGER business_rule;

    • B. 

      DELETE TRIGGER business_rule;

    • C. 

      REMOVE TRIGGER business_rule;

    • D. 

      ALTER TRIGGER business_rule;

    • E. 

      DELETE FROM USER_TRIGGER WHERE TRIGGER_NAME= 'BUSINESS_RULE';

  • 2. 
    The QUERY_PRODUCT procedure directly references the product table. There is a NEW_PRODUCT_VIEW view created based on the NOT NULL columns of the table. The ADD_PRODUCT procedure updates the table indirectly by the way of NEW_PRODUCT_VIEW view. Under which circumstances does the procedure ADD_PRODUCT get invalidated but automatically get complied when invoked?
    • A. 

      When the NEW_PRODUCT_VIEW is dropped.

    • B. 

      When rows of the product table are updated through SQI Plus.

    • C. 

      When the internal logic of the QUERY_PRODUCT procedure is modified.

    • D. 

      When a new column that can contain null values is added to the product table.

    • E. 

      When a new procedure s created that updates rows in the product table directly.

  • 3. 
    Which type of argument passes a value from a calling environment?
    • A. 

      VARCHER2.

    • B. 

      BOOLEAN.

    • C. 

      OUT.

    • D. 

      IN.

  • 4. 
    You need to create a trigger on the EMP table that monitors every row that is changed and places this information into the AUDIT_TABLE. Which type of trigger do you create?
    • A. 

      Statement-level trigger on the EMP table.

    • B. 

      For each row trigger on the EMP table.

    • C. 

      Statement-level trigger on the AUDIT_TABLE table.

    • D. 

      For each row statement level trigger on the EMP table.

    • E. 

      For each row trigger on the AUDIT_TABLE table.

  • 5. 
    Under which situation do you create a server side procedure?
    • A. 

      When the procedure contains no SQL statements.

    • B. 

      When the procedure contains no PL/SQL commands.

    • C. 

      When the procedure needs to be used by many client applications accessing several remote databases.

    • D. 

      When the procedure needs to be used by many users accessing the same schema objects on a local database.

  • 6. 
    Examine this procedure CREATE OR REPLACE PROCEDURE ADD_PLAYER (V_ID IN NUMBER, V_LAST_NAME VARCHER2) IS BEGIN INSERT INTO PLAYER(ID,LAST_NAME). VALUES(V_ID,V_LAST_NAME); COMMIT; END; This procedure must invoke the UPD-STAT procedure and pass a parameter. Which statement will successfully invoke this procedure?
    • A. 

      EXECUTE ADD_PLAYER (10,a);

    • B. 

      ADD_PLAYER (10,a);

    • C. 

      RUN ADD_PLAYER (10,a);

    • D. 

      START ADD_PLAYER (10,a);

  • 7. 
    Which code successfully calculates tax?
    • A. 

      CREATE OR REPLACE PROCEDURE calc (p_no IN NUMBER) RETURN tax IS V_sal NUMBER; Tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE EMPNO=p_no; Tax:=v_sal * 0. 05; END;

    • B. 

      CREATE OR REPLACE FUNCTION calctax(p_no NUMBER) RETURN NUMBER IS V_sal NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno =p_no; RETURN(v_sal* 0. 05); END;

    • C. 

      CRETAE OR REPLACE FUNCTION calctax(p_no NUMBER) RETURN NUMBER IS V_sal NUMBER; Tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno =p_no; Tax:=v_sal * 0. 05; END;

    • D. 

      CREATE OR REPLACE FUNCTION calctax(p_no NUMBER)IS V_sal NUMBER; Tax NUMBER; BEGIN SELECT sal INTO v_sal FROM emp WHERE empno =p_no; Tax :=v_sal * 0. 05; RETURN(tax); END;

  • 8. 
    Which two statements about the overloading feature of packages are true? (Choose two)
    • A. 

      Only local or packaged sub programs can be overloaded.

    • B. 

      Overloading allows different functions with the same name that differ only in their return types.

    • C. 

      Overloading allows different subprograms with the same number, type and order of the parameter.

    • D. 

      Overloading allows different subprograms with the same name and same number or type of the parameters.

    • E. 

      Overloading allows different subprograms with the same name but different in either number or type or order of parameter.

  • 9. 
    CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON emp BEGIN INSERT INTO audit_table (who, audited) VALUES(USER, SYSDATE); END; You issue an update command on the EMP table that results in changing ten rows. How many rows are inserted into the AUDIT_TABLE?
    • A. 

      1

    • B. 

      10

    • C. 

      None

    • D. 

      Value equal to the number of rows in the emp table

  • 10. 
    All users currently have the INSERT privileges on the PLAYER table. You want only your users to insert into this table using the ADD_PLAYER procedure. Which two actions must you take? (Choose two)
    • A. 

      GRANT SELECT ON ADD_PLAYER TO PUBLIC;

    • B. 

      GRANT EXECUTE ON ADD_PLAYER TO PUBLIC;

    • C. 

      GRANT INSERT ON PLAYER TO PUBLIC;

    • D. 

      GRANT EXECUTE, INSERT ON ADD_PLAYER TO PUBLIC;

    • E. 

      REVOKE INSERT ON PLAYER FROM PUBLIC;

  • 11. 
    Examine this trigger. CREATE OR REPLACE TRIGGER UPD_TEAM_SALARY AFTER INSERT OR UPDATE OR DELETE ON PLAYER FOR EACH ROW BEGIN UPDATE TEAM SET TOT_SALARY=TOT_SALARY+:NEW SALARY. WHERE ID=:NEW:TEAM_ID; You will be adding additional coat later but for now you want the current block to fire when updated the salary column. Which solution should you use to verify that the user is performing an update on the salary column?
    • A. 

      ROW_UPDATE('SALARY')

    • B. 

      UPDATING('SALARY')

    • C. 

      CHANGING('SALARY')

    • D. 

      COLUMN_UPDATE('SALARY')

  • 12. 
    Examine this package CREATE OR REPLACE PACKAGE discounts IS G_ID NUMBER:=7839; DISCOUNT_RATE NUMBER O. 00; PROCEDURE DISPLAY_PRICE (V_PRICE NUMBER); END DISCOUNTS; / CREATE OR REPLACE PACKAGE BODY discounts IS PROCEDURE DISPLAY_PRICE (V_PRICE_NUMBER) IS BEGIN DBMS_OUTPUT.PUT_LINE('DISCOUNTED||2_4 (V_PRICE*NVL(DISCOUNT_RATE, 1))) END DISPLAY_PRICE; BEGIN DISCOUNT_RATE;=0. 10; END DISCOUNTS; / Which statement is true?
    • A. 

      The value of DISCOUNT_RATE always remain 0. 00 in a session.

    • B. 

      The value of DISCOUNT_RATE is set to 0. 10 each time the package are invoked in a session.

    • C. 

      The value of DISCOUNT_RATE is set to 1 each time the procedure DISPLAY_PRICE is invoked.

    • D. 

      The value of DISCOUNT_RATE is set to 0. 10 when the package is invoked for first time in a session.

  • 13. 
    Which two statements are true about associative arrays and varrays? (Choose two.)
    • A. 

      Only varrays must start with the subscript 1.

    • B. 

      Only varrays can be used as column types in database tables.

    • C. 

      Both associative arrays and varrays must start with the subscript 1.

    • D. 

      Both associative arrays and varrays can be used as column types in database tables.

  • 14. 
    This statement fails when executed: CREATE OR REPLACE TRIGGER CALC_TEAM_AVG AFTER INSERT ON PLAYER BEGIN INSERT INTO PLAYER_BAT_STAT (PLAYER_ID, SEASON_YEAR,AT_BATS,HITS) VALUES (:NEW.ID, 1997, 0,0); END; To which type must you convert the trigger to correct the error?
    • A. 

      Row

    • B. 

      Statement

    • C. 

      ORACLE FORM trigger

    • D. 

      Before

  • 15. 
    The add_player , upd_player_stat , and upd_pitcher_stat procedures are grouped together in a package. A variable must be shared among only these procedures. Where should you declare this variable?
    • A. 

      In the package body

    • B. 

      In a database trigger

    • C. 

      In the package specification

    • D. 

      In each procedure's DECLARE section, using the exact same name in each

  • 16. 
    What happens during the execute phase with dynamic SQL for INSERT, UPDATE, and DELETE operations?
    • A. 

      The rows are selected and ordered.

    • B. 

      The validity of the SQL statement is established.

    • C. 

      An area of memory is established to process the SQL statement.

    • D. 

      The SQL statement is run and the number of rows processed is returned.

    • E. 

      The area of memory established to process the SQL statement is released.

  • 17. 
    Which three are valid ways to minimize dependency failure? (Choose three.)
    • A. 

      Querying with the SELECT * notation

    • B. 

      Declaring variables with the %TYPE attribute

    • C. 

      Specifying schema names when referencing objects

    • D. 

      Declaring records by using the %ROWTYPE attribute

    • E. 

      Specifying package.procedure notation while executing procedures

  • 18. 
    Which two statements about packages are true? (Choose two.)
    • A. 

      Packages can be nested.

    • B. 

      You can pass parameters to packages.

    • C. 

      A package is loaded into memory each time it is invoked.

    • D. 

      The contents of packages can be shared by many applications.

    • E. 

      You can achieve information hiding by making package constructs private.