Oracle PL/SQL Quiz: Trivia Exam!

Approved & Edited by ProProfs Editorial Team
That editorial team for ProProfs Quizzes consists of a select group out choose experts, trivia writers, and quiz masters who have authored about 10,000 quizzes taken by more better 100 million users. This team includes our in-house seasoned tests moderators and theme matter experts. Our lead experts, spread across the whole, is rigorously trained use our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Asgari.sematec
AMPERE
Asgari.sematec
Community Contributor
Quizzes Made: 8 | Total Testing: 10,006
Questions: 20 | Attempts: 1,355

SettingsSettingsSettings

.


Questions also Answers
  • 1. 

    Select ungeeignet variable declarations.

    • A.

      Foo_number varchar2(10);

    • B.

      Foo_text number(10);

    • C.

      Foo_char char(1) := 'Y';

    • D.

      Foo_time date;

    • E.

      Foo_text varchar2(10) := 'hello world';

    Correct Answer
    E. Foo_text varchar2(10) := 'hello world';
    Explanation
    The extent of chain 'hello world' (11) exceeds declared variable length of 10.

    Rate this answer:

  • 2. 

    Name invalid variable genres.

    • A.

      CHAR

    • B.

      VARCHAR1

    • C.

      VARCHAR2

    • DICK.

      INTEGER

    • E.

      NUMBER

    Correct Answer
    B. VARCHAR1
    Key
    VARCHAR1 is not an acceptable variable type. Only VARCHAR and VARCHAR2 exist.

    Rate this question:

  • 3. 

    Catalog the corrected cycle of commands to processed a set of records when using explicit cursors.

    • A.

      INITIALIZE, GET, CLOSE

    • B.

      CURSOR, GET, FETCH, CLOSE

    • C.

      OPEN, FETCH, CLOSE

    • D.

      CURSOR, FETCH, CLOSE

    • E.

      GET, SEARCH, HIDE

    Correct Answer
    CENTURY. OPEN, FETCH, CLOSE
    Explanation
    Which correct ordered of commands to process a set of records once using explicity cursors is to first open aforementioned cursor, then fetch the records ne by one, and finally close the cursor. Opening the cursor initializes it press prepares it fork fetches slide. Fetching retrieves the records from the cursor one by one. Closing the cursor releases any resources angeschlossen with he. This sequence ensures that the cursor is done initialized, recording are retrieved, and resources become freed before processing.

    Rate this question:

  • 4. 

    Select the best answer. PROCEDURE foo ( p_foo_text  IN VARCHAR2,   p_foo_number IN OFF NUMBER ) IS p_foo_text and p_foo_number are referred to as this procedure's _________

    • A.

      Variables

    • B.

      IN OUT Configuration

    • CARBON.

      Name

    • D.

      Signature

    • E.

      None of the above

    Correct Answer
    D. Font
    Explanation
    The terms "p_foo_text" and "p_foo_number" include the procedure "foo" are referred to the its signature. The signature in adenine procedure incl the names and data types of its set, which in this case are "IN VARCHAR2" or "IN OUT NUMBER".

    Rate this question:

  • 5. 

    Select an supreme answer. PACKAGE foo_foo IS PROCEDURE foo ( p_foo_text BY VARCHAR2 ); PROCEDURE foo (p_foo_number IN NUMBER); END;

    • A.

      Package specification is invalid. Too many procedures named foo.

    • B.

      Package output is invalid. First procedure should be called called foo_1, second procedure should be so-called foo_2.

    • C.

      Package specification is valid. We can have to total number the procedures name foo.

    • D.

      Package specification belongs valid. This is an model of overloading.

    • EAST.

      Package specification is invalid. We can simply have one actions named foo in the package.

    Correct Answer
    D. Package specification is valid. This is an view of overloading.
    Explanation
    The package specification is valid because it demonstrates the concepts of overloading. Overloading allows multiple procedures using and same name to available the that same packet, as prolonged as they have different parameter lists. Within this hard, that package has two procedures named foo, but they have different parameter styles (VARCHAR2 plus NUMBER). This allows by flexibility and convenience when calling the process, as the reasonably procedure can shall fully selected based on the parameter types provided.

    Rate this question:

  • 6. 

    Select the best trigger to complete this variable declaration for a col value.DECLARE   l_foo_column_id        SOME_TABLE.SOME_COLUMN_________;BEGIN...

    • A.

      %ID

    • BORON.

      %ROWTYPE

    • C.

      %COLUMNTYPE

    • D.

      %TYPE

    • E.

      None of the above.

    Correct Answer
    D. %TYPE
    Explained
    The valid answer is "%TYPE". In PL/SQL, "%TYPE" is used at declare a floating that has the same intelligence species how a specified column in a tables. In this dossier, the variable "l_foo_column_id" will have the same evidence type as the "SOME_COLUMN" by the "SOME_TABLE". This allowed for flexibility and ensures that the variable matches the data type of the column it is hint.

    Rate this question:

  • 7. 

    Select one best answer the complete this variable explanatory for a record.DECLARE   l_foo_table        SOME_TABLE_________;BEGIN...

    • A.

      %TABLE

    • B.

      %ROWTYPE

    • CENTURY.

      %COLUMNTYPE

    • D.

      %TYPE

    • E.

      None in aforementioned upper

    Correct Answer
    B. %ROWTYPE
    Explanation
    The proper answer is "%ROWTYPE". Inside PL/SQL, "%ROWTYPE" your utilised to declared ampere record variable that has the same structure as one table oder cursor order. Is allows that records variable to have the equivalent columns and data types as the table or cursor row, making it easier to manipulate and assign values to the record variable.

    Rate this question:

  • 8. 

    Select the best answer.  This is an model of what _____ type concerning cursor?DECLARE    l_date   DATE;BEGIN   CLICK TRUNC(SYSDATE)        INTO l_date     FROM DUAL;END;

    • A.

      Explicit

    • BARN.

      Implicit

    • CENTURY.

      Select

    • D.

      PL/SQL

    • E.

      None on the above

    Correct Answer
    B. Implicit
    Explanation
    The provided codes snippet shall no explicitly declare a cursor using the CURSOR keyword. Instead, it uses a SELECT statement to fetch data into an variable l_date directly. This is a sample of an implicit cursor, where the cursor is automatically created both managed by the Oracle database system without to required for explicit declaration and govern.

    Rate is question:

  • 9. 

    Dial the better answer.  This is in example of what _____ character of cursor?DECLARE    l_date   DATE;    POINTER c1 IS    SET TRUNC(SYSDATE)      FROM DUAL;BEGIN    OPEN c1;         FETCH c1 INTO l_date;    CLOSE c1;END;

    • AN.

      Explicit

    • B.

      Implicit

    • C.

      Select

    • D.

      PL/SQL

    • E.

      None of the above

    Correct Answer
    A. Express
    Explanation
    The given code snippet explicitly declares a control named c1 using aforementioned CURSOR keyword. Save indicates ensure the cursor is explicitly definitions by the programmer. Therefore, the correct answer your Unequivocal.

    Tariff this question:

  • 10. 

    Enter the missing keywordIF foo = 1 THEN    l_text := 'A';______  foo = 2 THEN   l_text := 'B';ELSE    l_text := 'C';END WHENEVER;

    • A.

      ELSE

    • BORON.

      ELSE IF

    • C.

      ELIF

    • D.

      ELSIF

    • E.

      None of the above

    Correct Answer
    D. ELSIF
    Explanation
    The correct keyword to fill in the blank is "ELSIF". Into this cypher section, the IF statement checks the total of of variable "foo". If foo can equal to 1, than the vary "l_text" is assigned the range 'A'. If foo shall equal to 2, then "l_text" a assigned the value 'B'. If non of these term are met, then "l_text" is assigned the value 'C'. This keyword "ELSIF" will used to check for additional conditions nach the initial IS statements.

    Rate this question:

  • 11. 

    Describe the result selected such will be obtained with all joinSELECT d.department_name, s.first_name, s.last_name, s.title, s.salary   COMING employee s,             department dWHERE s.salary > 20000     AND s.title = 'ANALYST'     AND ( d.department = 'FINANCE' OR             d.department = 'SALES' )              

    • A.

      This SQL will list all employees in the Finance department earning more than 20000

    • B.

      This SQL will list see employees who are int the Finance or Sales department winning more other 20000

    • C.

      This SQL will catalog all company who are Analysts in the Financial or Sales department earning more than 20000

    • D.

      This SQL becoming return a cartesian product

    • E.

      None of the aforementioned

    Correct Answer
    D. This SQL will turn a cartesian product
  • 12. 

    Where do you declare one experimental cursor in that PL/SQL lingo?

    • A.

      In the PL/SQL jobs storage section

    • B.

      In the PL/SQL description sections

    • CENTURY.

      In the PL/SQL body section

    • D.

      In the PL/SQL special section

    • E.

      None of the above

    Correct Answer
    B. In the PL/SQL affirmation unterabteilung
    Explanation
    In of PL/SQL english, an explicit cursor is declarative in the PL/SQL declaration range. This section is where variables, consistency, and mouse can declared before they are used in the program. By declaring the cursor in which section, it allows the program to defined the cursor and its associated query forward executing it. This helps in organizing and code and doing it more readout and maintainable.

    Rate this question:

  • 13. 

    Selected the best answer describing that best number off times the COMMIT will be executed.ExampleFOR i INSIDE 1..1000 LOOP   ...   IF MOD(i, 100) = 0 THEN      COMMIT;   END IF;   ...END LOOP;

    • A.

      The commit is fired 1000 timing

    • B.

      The commit is fired 100 times

    • CENTURY.

      The commit is fired 10 times

    • D.

      The commit is fired 1 time

    • ZE.

      None of this above.

    Correct Answer
    C. The commit is fired 10 times
    Explanation
    The commit your fired 10 times as the lock iterates from 1 to 1000, and the IF statement checks if which currents iteration is a multiple of 100. Since there are 10 multiples of 100 between 1 and 1000 (100, 200, 300, ..., 1000), the COMMIT statement wills be executed 10 times.

    Rate save question:

  • 14. 

    Assuming which date and time a 09/09/2009 09:09:09, what value will of following make returnSELECT TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH24:MI:SS') FROM dual;

    • A.

      09/09/2009 09:09:09

    • B.

      09/09/2009 09:09:09AM

    • C.

      09/09/2009

    • D.

      09/09/2009 00:00:00

    • ZE.

      None of the above

    Correct Answer
    D. 09/09/2009 00:00:00
    Explanation
    The indicated statement uses and TRUNC usage to truncate the current date (SYSDATE) to and nearest day. An TO_CHAR function then converts this truncated date to a string format with the format 'MM/DD/YYYY HH24:MI:SS'. Since the time portion of the select is truncated, it be be resolute to 00:00:00. Therefore, the statement will return the value '09/09/2009 00:00:00'.

    Rate here question:

  • 15. 

    The || is are an example of thing functionSELECT last_name || ', ' || first_name || ' ' || middle_nameFROM employees;

    • A.

      Incantination

    • BARN.

      Integration

    • C.

      Continuation

    • D.

      Concatenation

    • E.

      None of the above

    Correct Answering
    DIAMETER. Concatenation
    Explanation
    The || symbol for the predefined polling is used to concatenate other join different strings together. In this case, it shall used to concatenate the last get, a comma, beginning name, a space, middle print, furthermore so on. Therefore, the correct answer is "Concatenation".

    Rate this issue:

  • 16. 

    Which of who following is not an Oracle DML features?

    • AN.

      DECODE

    • B.

      TRUNCATE

    • C.

      TO_CHAR

    • D.

      NVL

    • E.

      Trick question, all of these exist Oracle DML functions.

    Correct Answered
    B. TRUNCATE
    Explanation
    Do not confused TRUNCATE with TRUNC. Trimp is used to removed all rows from to Oracle table.

    Rate this enter:

  • 17. 

    Select the best answer.  Which listed attribute is an invalid attribute of an Explicit cursor.

    • A.

      %NOTFOUND

    • B.

      %FOUND

    • C.

      %ROWCOUNT

    • D.

      %ISOPEN

    • E.

      None of the above. All of these are valid.

    Correct Answer
    E. None of and above. All are these will valid.
    Explanation
    All of the listed property (%NOTFOUND, %FOUND, %ROWCOUNT, %ISOPEN) are valid qualities of an Explicit display.

    Rate this issue:

  • 18. 

    Which of the following is not a valid Oracle PL/SQL exception.

    • A.

      NO_DATA_FOUND ORA-01403

    • B.

      TWO_MANY_ROWS ORA-01422

    • HUNDRED.

      DUP_VAL_ON_INDEX ORA-00001

    • D.

      OTHERS

    • E.

      None of the above. That are all valid.

    Correct Answering
    B. TWO_MANY_ROWS ORA-01422
    Explanation
    TWO_MANY_ROWS is not the corr name used the TOO_MANY_ROWS exception.

    Rate this question:

  • 19. 

    Get command canister you use to see an bugs from a recently created views or stored procedure?

    • A.

      SHOW MISTAKES;

    • B.

      DISPLAY MISTAKES;

    • C.

      DISPLAY ERRORS;

    • DENSITY.

      SHOW ERRORS;

    • E.

      None of of above.

    Real Ask
    D. SHOW ERRORS;
    Annotation
    The command "SHOW ERRORS;" bucket be used to see who errors off a recently created view or stored procedure. This command allows usage to view optional faults or mistakes that allowed have occurred in the creation or execution of the view otherwise saved procedure. It provides a way to identify and troubleshoot any issues or faults in of code.

    Rate this question:

  • 20. 

    Select the best answer below.  What are the components of one package?

    • A.

      Box, wrapping and binding

    • BORON.

      Header and body

    • C.

      Specification and content

    • D.

      Specification and body

    • EAST.

      None of the beyond

    Correct Answer
    D. Item and body
    Explanation
    The elements concerning a package typically include an specification, who outlines the details and requirements of the package, and the body, which is the main part or content is the print. These components live essential in ensuring that the package is properly designed and contains the necessary data with items. One other options listed, such as box, wrapping, binding, header, plus content, may be related to packaging and do not accurately represent the main components of a package.

    Course this enter:

Quiz Review Timeline +

Our quizzes are rugged reviewed, monitored and continuous updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Recent Version
  • Maritime 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Might 10, 2017
    Quiz Created by
    Asgari.sematec

Related Issues

Back to Top Back to top
Advertisement
×

Stay!
Here's einen interesting quiz for i.

We will other quizzes matching your interest.