Related Topics
Take Another Quiz

Oracle SQL, Pl/SQL Quiz

30 Questions
Oracle Quizzes & Trivia
Questions and Answers
  • 1. 
    • 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. 
    • A. 

      INSTR.

    • B. 

      NVL2.

    • C. 

      TRUNCATE.

    • D. 

      DECODE.

    • E. 

      TRIM.

    • F. 

      NVL.

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

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

  • 10. 
    Which is following Statements to create users?
    • A. 

      Create user user_name identified user_password;

    • B. 

      Create user user_name user_password;

    • C. 

      Create user user_name identified by user_password;

    • D. 

      None of these;

  • 11. 
    • A. 

      CASCADE

    • B. 

      UNIQUE

    • C. 

      NONUNIQUE

    • D. 

      CHECK

    • E. 

      PRIMARY KEY

    • F. 

      CONSTANT

    • G. 

      NOT NULL

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

      GROUP BY

    • B. 

      ORDER BY

    • C. 

      SORT BY

    • D. 

      HAVING BY

  • 13. 
    • A. 

      It allows a grantee DBA privileges.

    • B. 

      It is required syntax for object privileges.

    • C. 

      It allows privileges on specified columns of tables.

    • D. 

      It is used to grand an object privilege on a foreign key column.

    • E. 

      It allows the grantee to grand object privileges to other users and roles.

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

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

  • 16. 
    Which one is a system privilege?
    • A. 

      DROP

    • B. 

      DELETE

    • C. 

      TRUNCATE

    • D. 

      ALTER TABLE

    • E. 

      CREATE TABLE

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

  • 18. 
    • A. 

      Composite keys.

    • B. 

      Determinants.

    • C. 

      Candidate keys.

    • D. 

      Foreign keys.

  • 19. 
    • 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));

  • 20. 
    • A. 

      Row of a table.

    • B. 

      Key of a table.

    • C. 

      Column of a table.

    • D. 

      Two dimensional table

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

  • 22. 
    • 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'

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

      ADD RECORD

    • B. 

      ADD NEW

    • C. 

      INSERT INTO

    • D. 

      INSERT NEW

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

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

  • 26. 
    Can you commit inside a Trigger?
    • A. 

      Yes, always

    • B. 

      No, never

    • C. 

      Yes, in autonomous transactions

    • D. 

      Except for autonomous transactions

  • 27. 
    • A. 

      256 chars

    • B. 

      255 chars

    • C. 

      512 chars

    • D. 

      511 chars

    • E. 

      None of the above

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

      Yes, always

    • B. 

      Yes, but not always

    • C. 

      No, never

  • 29. 
    Maximum number of columns in a table or view in Oracle 9i?
    • A. 

      250

    • B. 

      500

    • C. 

      1000

    • D. 

      5000

    • E. 

      Infinite

  • 30. 
    • A. 

      Char(0)

    • B. 

      Char(1)

    • C. 

      NULL

    • D. 

      None of the above

Related Topics