Database Mock 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 Poornima972_pati
P
Poornima972_pati
Community Contributor
Quizzes Created: 2 | Total Attempts: 11,336
Questions: 16 | Attempts: 8,190

SettingsSettingsSettings
Database Mock Test - Quiz

Here is a very interesting quiz which is a database mock test for you. We have prepared this quiz to test your knowledge of the database and how well you understand that. There are many questions on the topic in the quiz; you will need to answer as many correctly as you can. In the end, your score will be a reflection of your knowledge of the subject. Let's go for it. Best of luck to you!


Questions and Answers
  • 1. 

    All PLANS are stored in ____DB2 directory_____________________.

    • A.

      SY.SYSPL

    • B.

      SYPSL.SB

    • C.

      SYSIBM.SYSPL

    • D.

      None of these

    Correct Answer
    C. SYSIBM.SYSPL
    Explanation
    The correct answer is SYSIBM.SYSPL. This is because the question is asking where all the PLANS are stored, and the SYSIBM.SYSPL directory is the specific directory where these PLANS are stored. The other options, SY.SYSPL and SYPSL.SB, are not valid directories for storing PLANS.

    Rate this question:

  • 2. 

    Count(*) will return -----------------if the target table is empty.

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      3

    Correct Answer
    A. 0
    Explanation
    The count(*) function in SQL returns the number of rows in a table. If the target table is empty, there are no rows, so the count(*) function will return 0.

    Rate this question:

  • 3. 

    ENTITY INTEGRITY is a state where a column that is part of a primary key can have null values.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    ENTITY INTEGRITY is a state where a column that is part of a primary key cannot have null values. This ensures that each record in a table is uniquely identified and prevents duplicate or missing values in the primary key column. Therefore, the statement that a column that is part of a primary key can have null values is incorrect.

    Rate this question:

  • 4. 

    An ______ is an ordered set of pointers to rows of a base table.

    • A.

      Index

    • B.

      Opened-file

    • C.

      Auto-file

    • D.

      None of these

    Correct Answer
    A. Index
    Explanation
    An index is an ordered set of pointers to rows of a base table. It allows for efficient retrieval of data by providing a quick way to locate specific rows based on the values in one or more columns. The index stores the values of the indexed columns along with the pointers to the corresponding rows, making it easier and faster to search for specific data in the table.

    Rate this question:

  • 5. 

    SQLCODE -922 is for authorization failure.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    SQLCODE -922 is indeed for authorization failure. In SQL, authorization failure occurs when a user attempts to access a database or perform a specific action without the necessary permissions or privileges. When this happens, the SQLCODE -922 is returned to indicate the authorization failure. This can happen if the user does not have the required privileges to execute a certain SQL statement or access a particular table or view.

    Rate this question:

  • 6. 

    We Can use MAX on a CHAR column.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In some database systems, it is possible to use the MAX function on a CHAR column. The MAX function is used to retrieve the maximum value from a column, and it can be applied to numerical as well as character data types. When used on a CHAR column, the MAX function will return the highest value based on the alphabetical order of the characters. However, it is important to note that this behavior may vary depending on the specific database system being used.

    Rate this question:

  • 7. 

    Every SQL statement is executable.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement "Every SQL statement is executable" is false. Not every SQL statement is executable as there are certain types of SQL statements that are used for defining database structures or performing administrative tasks rather than executing a specific action on the data. Examples of such statements include CREATE TABLE, ALTER TABLE, and GRANT. These statements do not directly manipulate the data but rather modify the structure or access rights of the database. Therefore, not all SQL statements are executable.

    Rate this question:

  • 8. 

    SUBSTR(CUSTNAME,1,3) will extract 1st 3 character from CUSTNAME string.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The function SUBSTR(CUSTNAME,1,3) is used to extract the first three characters from the CUSTNAME string. Therefore, the given statement is true.

    Rate this question:

  • 9. 

    Which of the following DB2 objects allows multiple users to access data in a table, with each only being able to access certain portions of the data?

    • A.

      Views

    • B.

      Aliases

    • C.

      indexes

    • D.

      Mirrored tables

    • E.

      table constraints

    Correct Answer
    A. Views
    Explanation
    Views in DB2 allow multiple users to access data in a table, with each user only being able to access certain portions of the data. Views provide a way to present a subset of the data from one or more tables, allowing users to see only the specific columns or rows that they are authorized to view. This can be useful for security purposes, as it allows for fine-grained control over the data that each user can access.

    Rate this question:

  • 10. 

    The final result of a DB2 BIND is

    • A.

      Load-module

    • B.

      DB2 catalog

    • C.

      Database request module

    • D.

      DB2 (application) Plan

    Correct Answer
    D. DB2 (application) Plan
    Explanation
    The final result of a DB2 BIND is the DB2 (application) Plan. This plan is created during the BIND process and contains the optimized access paths for executing SQL statements in the application. It is used by the DB2 optimizer to determine the most efficient way to access data and execute queries. The plan is stored in the DB2 catalog and is loaded into memory when the application is executed.

    Rate this question:

  • 11. 

    Which one of the following is NOT a DB2 object?

    • A.

      Storage Group

    • B.

      Table

    • C.

      Synonym

    • D.

      Column

    Correct Answer
    D. Column
    Explanation
    A column is not a DB2 object because it is a component of a table. In a relational database like DB2, a table is made up of rows and columns, where columns define the structure and data type of the data stored in the table. Therefore, while a storage group, table, and synonym are all examples of DB2 objects, a column is not considered a separate object but rather a part of a table object.

    Rate this question:

  • 12. 

    What does a positive value of SQL code mean?

    • A.

      Warning

    • B.

      Error

    • C.

      Successful execution

    • D.

      No rows found

    Correct Answer
    A. Warning
    Explanation
    A positive value of SQL code typically indicates a warning. This means that the SQL statement executed successfully, but there may be some potential issues or non-critical errors that occurred during the execution. It serves as a notification to the user that there might be something worth investigating or addressing, but it does not indicate a critical failure or error in the execution of the SQL code.

    Rate this question:

  • 13. 

    AUTOMATIC RECOMPILATION occurs when

    • A.

      An existing index is dropped.

    • B.

      A new index is created.

    • C.

      Both A and B

    • D.

      None of the above

    Correct Answer
    B. A new index is created.
    Explanation
    When a new index is created, it triggers the process of automatic recompilation. This process is necessary to update the database's query execution plans and optimize performance based on the new index. Dropping an existing index does not require automatic recompilation as it simply removes the index from the database. Therefore, the correct answer is that automatic recompilation occurs when a new index is created.

    Rate this question:

  • 14. 

    In DB2, DATA is physically stored in

    • A.

      VSAM ESDS.

    • B.

      VSAM KSDS.

    • C.

      VSAM LDS

    • D.

      TABLES

    Correct Answer
    C. VSAM LDS
  • 15. 

    DATABASE SERVICES doesn’t consist of  

    • A.

      BIND

    • B.

      RUNTIME SUPERVISOR

    • C.

      PACKAGES.

    • D.

      PRECOMPILER.

    Correct Answer
    C. PACKAGES.
    Explanation
    The correct answer is PACKAGES. Database services do not consist of packages. Packages are a way to organize and group related database objects together. They are not a part of the core database services but rather a feature or tool that can be used within the database system.

    Rate this question:

  • 16. 

    .______ is a single bound DBRM with an optimized access path.

    • A.

      Box

    • B.

      Package

    • C.

      File

    • D.

      None of these

    Correct Answer
    B. Package
    Explanation
    A package is a single bound DBRM with an optimized access path. It is a collection of related DBRMs that are stored together in a single package. The package contains information about the access path, which is the most efficient way to retrieve data from the database. By storing multiple DBRMs in a package, the access path can be optimized for the specific requirements of the application, resulting in improved performance. Therefore, a package is the correct answer as it provides an optimized access path for the DBRM.

    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
  • Nov 16, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 28, 2011
    Quiz Created by
    Poornima972_pati

Related Topics

Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.