SQL & PL/SQL

16 Questions | Total Attempts: 973

SettingsSettingsSettings
Pl SQL Quizzes & Trivia

Questions and Answers
  • 1. 
    PL/SQL  is a _______ language?
    • A. 

      Object oriented

    • B. 

      Block structured

    • C. 

      Object structured

    • D. 

      All the above

  • 2. 
    New values to the variables are assigned in which part of the PL/SQL code?
    • A. 

      Declaration section

    • B. 

      Command line

    • C. 

      Executable section

    • D. 

      Cannot assign at all

  • 3. 
    Which of the following provide an additional level of table security in SQL?
    • A. 

      Schema

    • B. 

      Index

    • C. 

      Views

    • D. 

      Segments

  • 4. 
    During the duplicate checking the null values are ignored?
    • A. 

      True

    • B. 

      False

  • 5. 
    ’grant’ and ‘revoke’ are _______ statements
    • A. 

      DDL

    • B. 

      DML

    • C. 

      DCL

    • D. 

      None of the above

  • 6. 
    Which Oracle access method is the fastest way for Oracle to retrieve a single row?
    • A. 

      Primary key access

    • B. 

      Access via unique index

    • C. 

      Table access by ROWID

    • D. 

      Full table scan

  • 7. 
    Which of the following can be a valid column name?
    • A. 

      Column

    • B. 

      1966_Invoices

    • C. 

      Catch_#22

    • D. 

      #Invoices

  • 8. 
    Which of the following SQL functions can operate on any datatype?
    • A. 

      TO_CHAR

    • B. 

      LOWER

    • C. 

      LPAD

    • D. 

      CEIL

  • 9. 
    Pick the  mandatory block  from the given blocks of a PL\SQL code
    • A. 

      Declarative

    • B. 

      Executable

    • C. 

      Exeption handling

  • 10. 
    With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
    • A. 

      SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

    • B. 

      SELECT LastName>'Hansen' AND LastName'Hansen' AND LastName'Hansen' AND LastName'Hansen' AND LastName

    • C. 

      SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName

  • 11. 
    With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
    • A. 

      DELETE FirstName='Peter' FROM Persons

    • B. 

      DELETE FROM Persons WHERE FirstName = 'Peter'

    • C. 

      DELETE ROW FirstName='Peter' FROM Persons

  • 12. 
    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';

  • 13. 
    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

  • 14. 
    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

    • D. 

      When INTO statement is missing in the SELECT statement

  • 15. 
    What is the result if two NULL values are compared to each other?
    • A. 

      TRUE

    • B. 

      FALSE

    • C. 

      Undefined

    • D. 

      NULL

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

      Create or replace function vat (vat_rate IN NUMBER, price IN NUMBER)

    • B. 

      Declare

    • C. 

      L_vat NUMBER;

    • D. 

      Begin

    • E. 

      L_vat := (vat_rate/100) * price; return l_vat;

    • F. 

      End;

Back to Top Back to top