Oracle SQL And PL/SQL Practice Quiz For Developers

30 Questions | Total Attempts: 14344

SettingsSettingsSettings
Please wait...
Oracle SQL And PL/SQL Practice Quiz For Developers

Oracle SQL and PL/SQL Practice Quiz For Developers. It consists of 30 basic to advanced programming questions to assist you in your practicing session. All the best as you go down to tackle these questions.


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. 
    Which of the following functions are available in SQL?
    • 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. 
    Which four are valid Oracle constraint types? (Choose four.)
    • 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. 
    What is true about the WITH GRANT OPTION clause?
    • 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. 
    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.

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

  • 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. 
    The primary key is selected from the:
    • A. 

      Composite keys.

    • B. 

      Determinants.

    • C. 

      Candidate keys.

    • D. 

      Foreign keys.

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

  • 20. 
    A tuple is a?
    • 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. 
    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'

  • 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

Back to Top Back to top