PL/SQL Questions Exam Quiz!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By CHN11AJ115
C
CHN11AJ115
Community Contributor
Quizzes Created: 1 | Total Attempts: 4,736
Questions: 10 | Attempts: 4,737

SettingsSettingsSettings
PL/SQL Questions Exam Quiz! - Quiz

Multiple choice questions. . .


Questions and Answers
  • 1. 

    How many tables may be included with a join?

    • A.

      One

    • B.

      Two

    • C.

      Three

    • D.

      All the above

    Correct Answer
    D. All the above
    Explanation
    A join operation combines rows from two or more tables based on a related column between them. In this case, the question is asking how many tables can be included in a join. The correct answer is "all the above" because a join can involve one table, two tables, or even three tables depending on the specific query and the relationships between the tables. Therefore, the answer encompasses all the possible scenarios for joining tables.

    Rate this question:

  • 2. 

    Which of the following SQL functions can operate on any data type?

    • A.

      TO_CHAR

    • B.

      LOWER

    • C.

      LPAD

    • D.

      CEIL

    Correct Answer
    D. CEIL
    Explanation
    The CEIL function in SQL is used to round a number up to the nearest integer. It can operate on any data type, whether it is a numeric or non-numeric data type. This makes it a versatile function that can be used in various scenarios regardless of the data type being used.

    Rate this question:

  • 3. 

    Assuming today is Monday, 21 NOV 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;  

    • A.

      03-NOV-00

    • B.

      10-NOV-00

    • C.

      28-NOV-00

    • D.

      17-NOV-00

    Correct Answer
    C. 28-NOV-00
    Explanation
    The statement "SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;" is returning the date of the next Monday after the current date. Since today is Monday, 21 NOV 2000, the next Monday after this date would be 28 NOV 2000. Therefore, the correct answer is 28-NOV-00.

    Rate this question:

  • 4. 

    In a PL/SQL block, a variable is declared as NUMBER without an initial value. What will its value be when it is first used in the executable section of the PL/SQL block?

    • A.

      NULL

    • B.

      0

    • C.

      Results in a compilation error

    • D.

      An exception will be raised

    Correct Answer
    A. NULL
    Explanation
    When a variable is declared as NUMBER without an initial value in a PL/SQL block, its value will be NULL when it is first used in the executable section of the block.

    Rate this question:

  • 5. 

    What is the result if two NULL values are compared to each other?

    • A.

      True

    • B.

      False

    • C.

      Undefined

    • D.

      Null

    Correct Answer
    D. Null
    Explanation
    When two NULL values are compared to each other, the result is NULL. This is because NULL represents an unknown or missing value, so the comparison cannot determine a definite result. Therefore, the answer is Null.

    Rate this question:

  • 6. 

    PL/SQL raises an exception, in which TWO of the following cases:

    • A.

      When a SELECT statement returns no rows

    • B.

      When a SELECT statement returns more than one row

    • C.

      When the datatypes of SELECT clause and INTO clause do not match

    Correct Answer(s)
    A. When a SELECT statement returns no rows
    B. When a SELECT statement returns more than one row
    Explanation
    PL/SQL raises an exception when a SELECT statement returns no rows because it is expecting at least one row to be returned. This can occur when the conditions in the WHERE clause are not met or when the table being queried is empty. PL/SQL also raises an exception when a SELECT statement returns more than one row because it is expecting only a single row to be returned. This can occur when the conditions in the WHERE clause are not specific enough or when there are duplicate records in the table.

    Rate this question:

  • 7. 

    Functions for error trapping are contained in which section of a PL/SQL block?

    • A.

      Header

    • B.

      Declarative

    • C.

      Executable

    • D.

      Exception

    Correct Answer
    D. Exception
    Explanation
    The functions for error trapping are contained in the Exception section of a PL/SQL block. This section is used to handle any exceptions or errors that may occur during the execution of the block. It allows the programmer to specify what actions should be taken when a specific error occurs, such as logging the error, displaying a message, or rolling back a transaction. By including error trapping functions in the Exception section, the programmer can ensure that their code handles errors gracefully and continues to execute without crashing.

    Rate this question:

  • 8. 

    The SQL WHERE clause

    • A.

      Limits the column data that are returned

    • B.

      Limits the row data are returned

    • C.

      Both A and B are correct.

    • D.

      Neither a or b is correct

    Correct Answer
    B. Limits the row data are returned
    Explanation
    The correct answer is "limits the row data that are returned." The SQL WHERE clause is used to filter the rows in a table based on a specified condition. It allows you to specify a condition that must be met for a row to be included in the result set. By using the WHERE clause, you can limit the rows that are returned from a query based on specific criteria, such as filtering rows with a certain value in a particular column. Therefore, the WHERE clause limits the row data that are returned.

    Rate this question:

  • 9. 

    Which of the following is true concerning triggers?

    • A.

      You do not create them with SQL

    • B.

      They execute against only some applications that access a database

    • C.

      They have an event, condition, and action

    • D.

      They cannot cascade (cause another trigger to fire).

    Correct Answer
    C. They have an event, condition, and action
    Explanation
    Triggers are database objects that are created with SQL and are used to automatically execute a set of actions when a specific event occurs in a database. These events can include insertions, updates, or deletions of data. Triggers also have conditions, which determine when the trigger should be executed, and actions, which specify what actions should be performed when the trigger is fired. Therefore, the statement "They have an event, condition, and action" is true concerning triggers.

    Rate this question:

  • 10. 

    In this PL/SQL statement, which of the following lines will produce an error?

    • A.

      Cursor CAPITALS is

    • B.

      Select CITY, STATE

    • C.

      Into my_city, my_state

    • D.

      From CITIES

    • E.

      Where CAPITAL = 'Y'

    • F.

      There are no errors in these statements

    Correct Answer
    C. Into my_city, my_state
    Explanation
    The line "into my_city, my_state" will produce an error because the INTO clause is used to fetch data from the cursor into variables, but the variables my_city and my_state have not been declared or defined in this PL/SQL statement.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Apr 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 21, 2011
    Quiz Created by
    CHN11AJ115
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.