Oracle Database MCQ Quiz Model Test

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 Leonfrnnd
L
Leonfrnnd
Community Contributor
Quizzes Created: 1 | Total Attempts: 2,071
Questions: 17 | Attempts: 2,071

SettingsSettingsSettings
Oracle Database MCQ Quiz Model Test - Quiz



Hey, do you have a good understanding of Oracle? If yes, then you must check out this awesome 'Oracle Database MCQ Quiz' that we've created below. As you would know, Oracle is a multi-model relational database management system, that is primarily designed for enterprise grid computing and data warehousing. Try answering the questions of this quiz and you'll get to know how much knowledge you have about this database system.


Questions and Answers
  • 1. 

    The employee table contains these columns: ID NUMBER(9) LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) COMMISSION NUMBER(7,2) You need to display the current commission for all employees.   Desired results are: 1. Display the commission multiplied by 1.5 48 2. Exclude employees with zero commission. 3. Display a zero for employees with null commission value.   Evaluate this SQL statement. SELECT id, last_name, first_name, commission*1. 5 FROM employee WHERE commission <>0; Which of the desired results does the statement provide?

    • A.

      All the desired results.

    • B.

      Two of the desired results.

    • C.

      One of the desired results

    • D.

      A syntax error.

    Correct Answer
    B. Two of the desired results.
    Explanation
    The given SQL statement SELECT id, last_name, first_name, commission*1.5 FROM employee WHERE commission 0; provides two of the desired results. It displays the commission multiplied by 1.5, as requested in the first desired result. It also excludes employees with zero commission by using the WHERE clause with the condition commission 0, as stated in the second desired result. However, it does not display a zero for employees with a null commission value, which is the third desired result.

    Rate this question:

  • 2. 

    Examine the table instance chart for the patient table. Column name Id_number Last_name first_name birth_date doctor_id Key type PK Nulls/Unique NN, UU FK table NN NN FK column Data type Length DOCTOR ID_NUMBER NUM 10 25 25 VARCHAR2 VARCHAR2 DATE NUM 10 You created the patient_vu view based on the id_number and last_name columns from the patient table. What is the best way to modify the view to contain only those patients born in 1997?

    • A.

      Replace the view adding a WHERE clause.

    • B.

      Use the ALTER command to add WHERE clause to verify the time.

    • C.

      Drop the patient_vu then create a new view with a WHERE clause.

    • D.

      Drop the patient_vu then create a new view with a HAVING clause

    Correct Answer
    A. Replace the view adding a WHERE clause.
    Explanation
    The best way to modify the view to contain only those patients born in 1997 is by replacing the view and adding a WHERE clause. This allows us to filter the data and include only the patients who were born in 1997.

    Rate this question:

  • 3. 

    Which table name is valid?

    • A.

      #_667.

    • B.

      Number.

    • C.

      Catch_#22.

    • D.

      1996_invoices

    • E.

      Invoices-1996.

    Correct Answer
    C. Catch_#22.
    Explanation
    The table name "Catch_#22" is valid because it follows the rules for naming tables in a database. Table names can contain letters, numbers, and underscores, but cannot start with a number or contain special characters like "#" or "-". Therefore, "Catch_#22" is the only option that meets these criteria.

    Rate this question:

  • 4. 

    State true or false. The user can go into SQL* PLUS and query the USER_TRIGGERS data dictionary view to see the compilation error that occur during the compilation of a trigger. 

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The user cannot go into SQL* PLUS and query the USER_TRIGGERS data dictionary view to see the compilation error that occurs during the compilation of a trigger. The USER_TRIGGERS view provides information about triggers in the user's schema, but it does not include details about compilation errors. To see compilation errors, the user can check the error logs or error messages generated during the compilation process.

    Rate this question:

  • 5. 

    The 'Where' clause is used for which of these three tasks? 

    • A.

      Compare two values

    • B.

      Designate a table location.

    • C.

      Only display data greater than a specified value.

    • D.

      Restrict the rows displayed.

    • E.

      Restrict the output of the group function.

    Correct Answer(s)
    A. Compare two values
    C. Only display data greater than a specified value.
    D. Restrict the rows displayed.
    Explanation
    The 'Where' clause is used to compare two values by specifying a condition that needs to be met for the rows to be included in the result set. It is also used to restrict the rows displayed by specifying certain criteria that the rows must satisfy. Additionally, it can be used to only display data greater than a specified value by using comparison operators such as '>', '=', or '

    Rate this question:

  • 6. 

    Pick the three SQL arithmetic expressions that return date. 

    • A.

      ‘08-jul-96’ + 7

    • B.

      ‘01-jul-96’ – 12

    • C.

      ‘03-jul-96’ + (12/24)

    • D.

      (‘03-jul-96’ – ‘04-jul-97’) /7

    Correct Answer(s)
    A. ‘08-jul-96’ + 7
    B. ‘01-jul-96’ – 12
    C. ‘03-jul-96’ + (12/24)
    Explanation
    The three SQL arithmetic expressions that return a date are '08-jul-96' + 7, '01-jul-96' - 12, and '03-jul-96' + (12/24). These expressions perform addition and subtraction operations on the given dates, resulting in a new date value. The first expression adds 7 days to the date '08-jul-96', the second expression subtracts 12 days from the date '01-jul-96', and the third expression adds 12 hours (12/24) to the date '03-jul-96'.

    Rate this question:

  • 7. 

    Pick the three DATETIME data types that can be used when specifying column definitions. 

    • A.

      TIMESTAMP

    • B.

      INTERVAL MONTH TO DAY

    • C.

       INTERVAL DAY TO SECOND

    • D.

      INTERVAL YEAR TO MONTH

    Correct Answer(s)
    A. TIMESTAMP
    C.  INTERVAL DAY TO SECOND
    D. INTERVAL YEAR TO MONTH
    Explanation
    TIMESTAMP, INTERVAL DAY TO SECOND, and INTERVAL YEAR TO MONTH are the three DATETIME data types that can be used when specifying column definitions. The TIMESTAMP data type is used to store date and time values, while INTERVAL DAY TO SECOND is used to store intervals of time in days, hours, minutes, and seconds. INTERVAL YEAR TO MONTH is used to store intervals of time in years and months. These data types provide flexibility in storing and manipulating date and time data in a database.

    Rate this question:

  • 8. 

    Which three SELECT statements display 2000 in the format "$2,000.00"? 

    • A.

      SELECT TO CNAR(2000, '$#,###.##') FROM dual;

    • B.

      SELECT TO CNAR(2000, '$0,000.00') FROM dual;

    • C.

      SELECT TO CNAR(2000, '$9,999.00') FROM dual;

    • D.

      SELECT TO CNAR(2000, '$9,999.99') FROM dual;

    • E.

      SELECT TO CNAR(2000, '$2,000.00') FROM dual;

    Correct Answer(s)
    B. SELECT TO CNAR(2000, '$0,000.00') FROM dual;
    C. SELECT TO CNAR(2000, '$9,999.00') FROM dual;
    D. SELECT TO CNAR(2000, '$9,999.99') FROM dual;
    Explanation
    The correct answer is SELECT TO CNAR(2000, '$0,000.00') FROM dual;, SELECT TO CNAR(2000, '$9,999.00') FROM dual;, SELECT TO CNAR(2000, '$9,999.99') FROM dual; These three SELECT statements will display 2000 in the format "$2,000.00" because the TO_CHAR function is used to convert the number 2000 into a character string with the specified format. The format '$0,000.00' specifies that the number should be displayed with a dollar sign, comma as a thousands separator, and two decimal places.

    Rate this question:

  • 9. 

    Contents of the packages can be shared by many applications

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement "Contents of the packages can be shared by many applications" is true. In software development, packages are used to organize and group related classes, interfaces, and other components. These packages can be accessed and used by multiple applications, allowing for code reusability and modularity. This promotes efficient development and maintenance of software systems by enabling the sharing and collaboration of resources among different applications.

    Rate this question:

  • 10. 

    YOU can acheive information hiding by making package constructs private.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Information hiding is a principle in software engineering that aims to restrict access to certain parts of a program, allowing only necessary information to be exposed. By making package constructs private, we can control the visibility of these constructs within the package, preventing external access and achieving information hiding. This ensures that the implementation details of the package are hidden from other parts of the program, promoting encapsulation and reducing dependencies. Therefore, the statement "YOU can achieve information hiding by making package constructs private" is true.

    Rate this question:

  • 11. 

    A CALL statement inside the trigger body enables you to call  a stored procedure

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A CALL statement inside the trigger body allows you to invoke a stored procedure. This means that when the trigger is triggered, it can execute a specific stored procedure, which can perform a series of predefined actions or operations. This enables you to have more control and flexibility in managing and manipulating data within the database. By calling a stored procedure from a trigger, you can automate complex tasks and ensure consistency in data manipulation.

    Rate this question:

  • 12. 

    Constants , a programmed constructs can be grouped witihn the packages

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because constants, which are fixed values that do not change during program execution, can be organized and grouped within packages. Packages provide a way to organize related classes and interfaces, and constants can be declared within these classes or interfaces. By grouping constants within packages, it becomes easier to manage and access them within the program. Therefore, the correct answer is true.

    Rate this question:

  • 13. 

     In SQL, Null values are displayed last in the ascending sequences.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In SQL, when sorting data in ascending order, Null values are displayed last. This means that if there are Null values in a column being sorted, they will appear at the bottom of the result set. This behavior is consistent across most SQL database systems and can be useful for identifying missing or incomplete data.

    Rate this question:

  • 14. 

    The SQL results are sorted by the first column in the SELECT list if the ORDER BY a clause is not provided.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    If the ORDER BY clause is not provided in an SQL query, the results are not necessarily sorted by the first column in the SELECT list. The order in which the results are returned is not guaranteed and can vary depending on the database system or other factors.

    Rate this question:

  • 15. 

    It is not possible to sort query results by a column that is not included in the SELECT list. State true or false. 

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    False. It is possible to sort query results by a column that is not included in the SELECT list. The SELECT list determines the columns that will be returned in the result set, but it does not restrict the ability to sort by other columns in the table.

    Rate this question:

  • 16. 

    Which privilege concerns with system level security?

    • A.

      Drop any table.

    • B.

      DELETE

    • C.

      ALTER

    • D.

      INDEX

    • E.

      UPDATE

    Correct Answer
    A. Drop any table.
    Explanation
    The privilege that concerns with system level security is the DROP privilege. This privilege allows a user to delete or drop any table in the database. It is a powerful privilege that should only be granted to trusted users, as it can potentially cause data loss or disruption to the system. The other options, DELETE, ALTER, INDEX, and UPDATE, are privileges that are related to manipulating data or modifying database objects, but they do not have the same level of impact on system security as the DROP privilege.

    Rate this question:

  • 17. 

    State true or false- The user do not explicitly open, fetch or close a cursor within a cursor for loop.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In a cursor for loop, the user does not need to explicitly open, fetch, or close a cursor. The cursor for loop automatically performs these actions internally. This loop is designed to simplify the process of iterating through the result set of a query by handling the cursor operations behind the scenes. Therefore, the statement "The user do not explicitly open, fetch or close a cursor within a cursor for loop" is true.

    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
  • Mar 29, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 24, 2011
    Quiz Created by
    Leonfrnnd
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.