Oracle SQL, PL/SQL Quiz

20 Questions | Total Attempts: 490

SettingsSettingsSettings
Please wait...
Pl SQL Quizzes & Trivia

Questions and Answers
  • 1. 
    Which of the following statements contains an error?
    • A. 

      SELECT * FROM emp WHERE empid = 493945;

    • B. 

      SELECT empid FROM emp WHERE empid= 493945;

    • C. 

      SELECT empid FROM emp;

    • D. 

      SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;

  • 2. 
    The command to remove rows from a table 'CUSTOMER' is:
    • A. 

      REMOVE FROM CUSTOMER...

    • B. 

      DROP FROM CUSTOMER...

    • C. 

      DELETE FROM CUSTOMER WHERE...

    • D. 

      UPDATE FROM CUSTOMER...

  • 3. 
    Which is an /SQL*Plus command?
    • A. 

      DELETE

    • B. 

      UPDATE

    • C. 

      SELECT

    • D. 

      ALTER

    • E. 

      DESCRIBE

  • 4. 
    In a SELECT statement that includes a WHERE clause, where is the GROUP BY clause placed in the SELECT statement?
    • A. 

      Immediately after the SELECT clause

    • B. 

      Before the WHERE clause

    • C. 

      Before the FROM clause

    • D. 

      After the ORDER BY clause

    • E. 

      After the WHERE clause

  • 5. 
    Which clause would you use in a SELECT statement to limit the display to those employees whose salary is greater than 5000?
    • A. 

      ORDER BY SALARY > 5000.

    • B. 

      GROUP BY SALARY > 5000

    • C. 

      HAVING SALARY > 5000

    • D. 

      WHERE SALARY > 5000

  • 6. 
    You need to calculate the total of all salaries in the accounting department. Which group function should you use?
    • A. 

      MAX

    • B. 

      MIN

    • C. 

      SUM

    • D. 

      COUNT

    • E. 

      TOTAL

    • F. 

      LARGEST

  • 7. 
    What does the TRUNCATE statement do?
    • A. 

      Removes the table

    • B. 

      Removes all rows from a table

    • C. 

      Shortens the table to 10 rows

    • D. 

      Removes all columns from a table

    • E. 

      Removes foreign keys from a table

  • 8. 
    Which two statements about creating constraints are true? (Choose two)
    • A. 

      Constraint names must start with SYS_C.

    • B. 

      All constraints must be defines at the column level.

    • C. 

      Constraints can be created after the table is created.

    • D. 

      Constraints can be created at the same time the table is created.

  • 9. 
    Which one of the following sorts rows in SQL?
    • A. 

      GROUP BY

    • B. 

      ORDER BY

    • C. 

      SORT BY

    • D. 

      HAVING BY

  • 10. 
    Which three statements about subqueries are true? (Choose three.)
    • A. 

      A main query can have more than one subquery.

    • B. 

      A subquery can have more than one main query.

    • C. 

      The subquery and main query must retrieve data from the same table.

    • D. 

      The subquery and main query can retrieve data from different tables.

    • E. 

      Only one column or expression can be compared between the subquery and main query.

    • F. 

      Multiple columns or expression can be compared between the subquery and main query.

  • 11. 
    What is true about sequences?
    • A. 

      The start value of the sequence is always 1.

    • B. 

      A sequence always increments by 1.

    • C. 

      The minimum value of an ascending sequence defaults to 1.

    • D. 

      The maximum value of descending sequence defaults to 1.

  • 12. 
    Which four are types of functions available in SQL? (Choose 4)
    • A. 

      String

    • B. 

      Character

    • C. 

      Integer

    • D. 

      Calendar

    • E. 

      Numeric

    • F. 

      Translation

    • G. 

      Date

    • H. 

      Conversion

  • 13. 
    Which is a valid CREATE TABLE statement?
    • A. 

      Create table emp add(id number(3));

    • B. 

      Create table emp (id number(3));

    • C. 

      Create table emp modified (id number(3));

    • D. 

      Create table emp (id numbers(3));

  • 14. 
    The DROP TABLE statement:
    • A. 

      Deletes the table structure only.

    • B. 

      Deletes the table structure along with the table data.

    • C. 

      Works whether or not referential integrity constraints would be violated.

    • D. 

      Is not an SQL statement.

  • 15. 
    How do you select all the records from a table named "EMP" where the value of the column "Last_Name" is "KING"?
    • A. 

      SELECT [all] FROM EMP WHERE Last_Name ='KING'

    • B. 

      SELECT * FROM EMP WHERE Last_Name ='KING'

    • C. 

      SELECT * FROM EMP WHERE Last_Name LIKE 'KING'

    • D. 

      SELECT [all] FROM EMP WHERE Last_Name LIKE 'KING'

  • 16. 
    Which SQL statement is used to insert new data in a database?
    • A. 

      ADD RECORD

    • B. 

      ADD NEW

    • C. 

      INSERT INTO

    • D. 

      INSERT NEW

  • 17. 
    The SQL ALTER statement can be used to:
    • A. 

      Change the table structure.

    • B. 

      Change the table data.

    • C. 

      Add rows to the table.

    • D. 

      Delete rows from the table.

  • 18. 
    Which command is used to remove the table 'DEPTT'?
    • A. 

      REMOVE FROM DEPTT

    • B. 

      DROP TABLE DEPTT

    • C. 

      DELETE FROM DEPTT

    • D. 

      UPDATE FROM DEPTT

  • 19. 
    Can you delete a column in table with data in Oracle?
    • A. 

      Yes, always

    • B. 

      Yes, but not always

    • C. 

      No, never

  • 20. 
    Maximum levels of subqueries in the WHERE clause of an SQL statement?
    • A. 

      127

    • B. 

      255

    • C. 

      511

    • D. 

      Unlimited

Back to Top Back to top