Oracle Functions And Coding Quiz Questions

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 Nikita_venkat
N
Nikita_venkat
Community Contributor
Quizzes Created: 1 | Total Attempts: 3,177
Questions: 14 | Attempts: 3,177

SettingsSettingsSettings
Oracle Functions And Coding Quiz Questions - Quiz

Hello there! Today, we're here to test your knowledge in a fun and easy way through this Oracle Functions and Coding quiz. As you would already know, Oracle is an on-premises application that is designed to solve the most challenging business needs of organizations of all sizes and industries. If you have learned about this subject previously, then you must try this quiz to see how much you remember the concepts. You might also get to learn some new facts about Oracle today. So, get ready and start answering.


Questions and Answers
  • 1. 

    Which of the following are attributes of /SQL*Plus? 

    • A.

      /SQL*Plus is the Oracle proprietary interface for executing SQL statements.

    • B.

      /SQL*Plus commands are accesses from a browser.

    • C.

      /SQL*Plus commands are used to manipulate data in tables.

    • D.

      /SQL*Plus commands manipulate table definitions in the database.

    Correct Answer(s)
    C. /SQL*Plus commands are used to manipulate data in tables.
    D. /SQL*Plus commands manipulate table definitions in the database.
    Explanation
    The correct answer is /SQL*Plus commands are used to manipulate data in tables.,/SQL*Plus commands manipulate table definitions in the database. This is because SQL*Plus is a command-line tool that allows users to interact with the Oracle database. It provides a set of commands that can be used to manipulate data in tables, such as inserting, updating, and deleting records. Additionally, SQL*Plus commands can also be used to manipulate table definitions, such as creating, altering, and dropping tables in the database.

    Rate this question:

  • 2. 

    Evaluate this SQL*Plus command: START delaccount Which task will this command accomplish?

    • A.

      It executes the DELACCOUNT PL/SQL routine.

    • B.

      It runs the DELACCOUNT.SQL script file.

    • C.

       It creates the DELACCOUNT file using the default file extension.

    • D.

      It invokes the editor to edit the contents of the DELACCOUNT file.

    Correct Answer
    B. It runs the DELACCOUNT.SQL script file.
    Explanation
    The SQL*Plus command "START delaccount" will run the DELACCOUNT.SQL script file. This command is used to execute a SQL script file in SQL*Plus. By specifying the name of the script file after the "START" command, SQL*Plus will read and execute the commands in the script file. Therefore, the given command will run the DELACCOUNT.SQL script file.

    Rate this question:

  • 3. 

    Which /SQL*Plus feature can be used to replace values in the WHERE clause?

    • A.

      Substitution variables

    • B.

      Replacement variables

    • C.

      Prompt variables

    • D.

      This feature cannot be implemented through /SQL*Plus.

    Correct Answer
    A. Substitution variables
    Explanation
    Substitution variables in SQL*Plus can be used to replace values in the WHERE clause. They allow users to dynamically substitute values into SQL statements at runtime. By using the "&" symbol followed by the variable name, users can prompt for input and replace the variable with the entered value in the WHERE clause. This feature provides flexibility and allows for more interactive and customizable queries.

    Rate this question:

  • 4. 

    Evaluate this SQL statement: SELECT c.customer_id, o.order_id, o.order_date, p.product_name FROM customer c, curr_order o, product p WHERE customer.customer_id = curr_order.customer_id AND o.product_id = p.product_id ORDER BY o.order_amount; This statement fails when executed. Which change will correct the problem?

    • A.

       Include the ORDER_AMOUNT column in the SELECT list.

    • B.

      Use the table name in the ORDER BY clause.

    • C.

      Remove the table aliases from the WHERE clause.

    • D.

      Use the table aliases instead of the table names in the WHERE clause.

    Correct Answer
    D. Use the table aliases instead of the table names in the WHERE clause.
    Explanation
    The correct answer is to use the table aliases instead of the table names in the WHERE clause. In the given SQL statement, table aliases are used for customer, curr_order, and product tables (c, o, p respectively). However, in the WHERE clause, the table names are used instead of the aliases. This causes the statement to fail when executed. By using the aliases in the WHERE clause, the problem can be corrected and the statement will execute successfully.

    Rate this question:

  • 5. 

    Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHARD2(10) START_DATE DATE END_DATE DATE. Which two aggregate functions are valid on the START_DATE column? (Choose two)

    • A.

      SUM(start_date)

    • B.

      AVG(start_date)

    • C.

      COUNT(start_date)

    • D.

      AVG(start_date, end_date)

    • E.

      MIN(start_date)

    Correct Answer(s)
    C. COUNT(start_date)
    E. MIN(start_date)
    Explanation
    The START_DATE column is of the DATE data type. The COUNT function can be used to count the number of non-null values in the START_DATE column. The MIN function can be used to find the minimum value in the START_DATE column. The SUM and AVG functions are not valid for the DATE data type. Therefore, the correct answers are COUNT(start_date) and MIN(start_date).

    Rate this question:

  • 6. 

    Which two tasks can you perform by using the TO_CHAR function?

    • A.

      Convert 10 to ‘TEN’

    • B.

      Convert ‘10’ to 10

    • C.

      Convert ‘10’ to ‘10’

    • D.

      Convert ‘TEN’ to 10

    Correct Answer
    C. Convert ‘10’ to ‘10’
    Explanation
    The TO_CHAR function in SQL is used to convert a number or date to a character string. It is not used to convert between different data types or to convert words to numbers. In this case, the correct answer is "Convert '10' to '10'" because it demonstrates the usage of TO_CHAR to convert a character string to another character string.

    Rate this question:

  • 7. 

    In which case would you use a FULL OUTER JOIN?

    • A.

      A. Both tables have NULL values.

    • B.

      B. You want all unmatched data from one table.

    • C.

      C. You want all matched data from both tables.

    • D.

      D. You want all unmatched data from both tables.

    • E.

      E. One of the tables has more data than the other.

    Correct Answer
    D. D. You want all unmatched data from both tables.
    Explanation
    A FULL OUTER JOIN is used when you want to retrieve all unmatched data from both tables. This means that you want to include all rows from both tables, even if there is no match between the tables based on the join condition. This is useful when you want to compare two tables and identify the differences or inconsistencies between them.

    Rate this question:

  • 8. 

    Which operator can be used in an outer join condition?

    • A.

      A. NOT

    • B.

      B. OR

    • C.

      C. IN

    • D.

      D. AND

    Correct Answer
    D. D. AND
    Explanation
    The AND operator can be used in an outer join condition. This operator allows for the combination of multiple conditions in a join statement. In an outer join, the AND operator is used to specify additional conditions that must be met for the join to occur. By using the AND operator, you can join tables based on multiple criteria, resulting in a more specific and targeted join operation.

    Rate this question:

  • 9. 

    Why do we use subquery?

    • A.

      Create groups of data.

    • B.

      Sort data in a specific order

    • C.

      Convert data to a different format

    • D.

      Retrieve data based on an unknown condition

    Correct Answer
    D. Retrieve data based on an unknown condition
    Explanation
    We use subqueries to retrieve data based on an unknown condition. Subqueries allow us to nest a query within another query, where the inner query is executed first and its result is used by the outer query to retrieve the desired data. This is particularly useful when we need to filter data based on a condition that cannot be determined in advance or when we need to compare values from different tables. By using subqueries, we can dynamically retrieve data based on the result of another query, making our queries more flexible and powerful.

    Rate this question:

  • 10. 

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCNAR2(25) LAST_NAME VARCNAR2(25) Which statement inserts a row into the table?

    • A.

      INSERT INTO employees( first_name, last_name) VALUES(‘John’,‘Smith’);

    • B.

      INSERT INTO employees(first_name,last_name, employee_id) VALUES ( 1000, ‘John’,‘Smith’);

    • C.

      INSERT INTO employees (employee_id) VALUES (1000);

    • D.

      INSERT INTO employees VALUES ( NULL, ‘John’,‘Smith’);

    Correct Answer
    C. INSERT INTO employees (employee_id) VALUES (1000);
    Explanation
    The correct answer is INSERT INTO employees (employee_id) VALUES (1000). This statement inserts a row into the EMPLOYEES table by specifying the value for the employee_id column as 1000. The other options either do not provide a value for the primary key column or include additional columns that are not specified in the table structure.

    Rate this question:

  • 11. 

    Which action will cause an automatic rollback?

    • A.

      Exiting from iSQL*Plus without first committing the chang

    • B.

      System crash

    • C.

      Subsequent DML statement

    • D.

      GRANT statement

    Correct Answer
    B. System crash
    Explanation
    A system crash can cause an automatic rollback because when a system crashes, it loses all the data that was not yet committed. This means that any changes made to the database during that session will be lost and rolled back to the previous state. Therefore, a system crash triggers an automatic rollback to maintain data integrity and consistency.

    Rate this question:

  • 12. 

    Examine this statement: SELECT student_id, gpa FROM student_grades WHERE gpa > &&value; You run the statement once, and when prompted you enter a value of 2.0. A report is produced. What happens when you run the statement a second time?

    • A.

      An error is returned.

    • B.

      You are prompted to enter a new value.

    • C.

      A report is produced that matches the first report produced.

    • D.

      You are asked whether you want a new value or if you want to run the report based on the previous value.

    Correct Answer
    C. A report is produced that matches the first report produced.
    Explanation
    When the statement is run for the second time, a report is produced that matches the first report produced. This is because the condition in the WHERE clause of the statement is comparing the "gpa" column with the entered value of 2.0. As long as there are records in the "student_grades" table with a "gpa" greater than 2.0, those records will be included in the report. The statement does not prompt for a new value or ask whether to use the previous value.

    Rate this question:

  • 13. 

    Which best describes an inline view?

    • A.

      A schema object

    • B.

      A subquery that can contain an ORDER BY clause

    • C.

      Another name for a view that contains group functions

    • D.

      A subquery that is part of the FROM clause of another query

    Correct Answer
    D. A subquery that is part of the FROM clause of another query
    Explanation
    An inline view is a subquery that is part of the FROM clause of another query. It is used to create a temporary table that can be used in the main query. This allows the main query to access and manipulate the data from the subquery as if it were a table. Inline views are useful when complex calculations or filtering needs to be done on a subset of data before joining it with other tables or performing further operations.

    Rate this question:

  • 14. 

    The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this?

    • A.

      GRANT select ON dept TO ALL_USERS;

    • B.

       GRANT select ON dept TO ALL;

    • C.

      GRANT QUERY ON dept TO ALL_USERS

    • D.

      GRANT select ON dept TO PUBLIC;

    Correct Answer
    D. GRANT select ON dept TO PUBLIC;
    Explanation
    The correct answer is "GRANT select ON dept TO PUBLIC". This statement grants the SELECT privilege on the DEPT table to all users in the PUBLIC group. By granting the privilege to PUBLIC, it allows all users to query the DEPT table. The other options mentioned do not grant the privilege to all users or use incorrect syntax.

    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
  • Jun 26, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 23, 2011
    Quiz Created by
    Nikita_venkat
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.