Test Your Data Base 2 Query Knowledge

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,384
Questions: 20 | Attempts: 3,154

SettingsSettingsSettings
Test Your Data Base 2 Query Knowledge - Quiz

In this quiz you will get to learn about queries of data base. Play this quiz and test your knowledge on this!


Questions and Answers
  • 1. 

    A concurrency control mechanisms is required to isolate the users from one another is called

    Explanation
    Concurrency control mechanisms are necessary in database systems to ensure that multiple users can access and modify data simultaneously without causing inconsistencies or conflicts. Locking is a commonly used mechanism that helps in achieving this isolation. By implementing locks, the system can restrict access to certain data or resources, allowing only one user at a time to modify them. This prevents any interference or overlap between users, ensuring data integrity and consistency. The use of locking helps in maintaining concurrency and avoiding issues like data corruption or incorrect results due to simultaneous access.

    Rate this question:

  • 2. 

     In referential integrity each foreign key value have a matching ___________ Value.

    • A.

      Primary key

    • B.

      Secondary key

    • C.

      Both

    Correct Answer
    B. Secondary key
    Explanation
    In referential integrity, each foreign key value must have a matching secondary key value. This means that the value in the foreign key column of a table must exist as a value in the corresponding secondary key column of another table. This ensures that the relationship between the tables is maintained and prevents orphaned records or inconsistencies in the data. The primary key is not mentioned in the question, so it is not the correct answer.

    Rate this question:

  • 3. 

    Write a query that will return the list of all employees whose names starts with ‘s’.    

  • 4. 

     One student (parent or root) can have multiple course( child) records.        Identify the model.

    • A.

      A. Network model

    • B.

      B. Relational model

    • C.

      C. Hierarchical model

    • D.

      D. Rotational model

    Correct Answer
    C. C. Hierarchical model
    Explanation
    In a hierarchical model, data is organized in a tree-like structure where each parent can have multiple children. In this scenario, the student (parent) can have multiple course records (children), indicating a hierarchical relationship between the two. Therefore, the correct model for this scenario is the hierarchical model.

    Rate this question:

  • 5. 

     SELECT ename , grade , sal FROM emp, salgrade .         WHERE sal BETWEEN losal AND hisal ORDER BY grade, job.         Above is an example of :

    • A.

      Self join

    • B.

      Inner join

    • C.

      Outer join

    • D.

      Non-equi join

    Correct Answer
    D. Non-equi join
    Explanation
    The given SQL query is an example of a non-equi join. A non-equi join is used when the join condition involves a comparison operator other than the equals (=) operator. In this query, the join condition is "sal BETWEEN losal AND hisal", which checks if the salary of an employee falls within the range specified by the losal and hisal columns in the salgrade table. Therefore, the query is performing a non-equi join between the emp and salgrade tables based on the salary range.

    Rate this question:

  • 6. 

     __________ command is used to modify an existing column .  

    Correct Answer
    ALTER TABLE
    Explanation
    The ALTER TABLE command is used to modify an existing column in a database table. It allows for changes such as changing the data type, adding or dropping constraints, renaming the column, or modifying its default value. This command is commonly used when there is a need to make changes to the structure or properties of a column in a table without having to recreate the entire table.

    Rate this question:

  • 7. 

     Collections are essentially just a means of giving a name to a logically related set of packages.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Collections in programming refer to a way of organizing and grouping related packages or objects together under a common name. This allows for easier management and manipulation of the grouped items. Therefore, the given statement that collections are a means of naming logically related sets of packages is true.

    Rate this question:

  • 8. 

     NULL indicates:  

    • A.

      Unknown

    • B.

      Zero

    • C.

      Space

    • D.

      None of the above

    Correct Answer
    A. Unknown
    Explanation
    NULL is a special value in programming and databases that indicates the absence of a value or a missing value. It is often used to represent unknown or undefined data. Therefore, in this context, NULL can be interpreted as indicating "unknown".

    Rate this question:

  • 9. 

    A mechanism that ensures data integrity between tables related by Primary & Foreign Keys

    • A.

      Pre-compilation

    • B.

      Referential Integrity

    • C.

      A and b

    • D.

      All the above

    Correct Answer
    B. Referential Integrity
    Explanation
    Referential Integrity is the correct answer because it is a mechanism that ensures data integrity between tables related by Primary & Foreign Keys. It ensures that relationships between tables are maintained and that any changes made to a table's primary key are properly reflected in related tables' foreign keys. This helps to maintain consistency and accuracy of data across the database. Pre-compilation is not related to data integrity, and "a and b" and "all the above" are not valid options as they do not provide a specific answer.

    Rate this question:

  • 10. 

     DB2 employs TSO as interactive and ____________.  

    Correct Answer
    Batch processing
    Explanation
    DB2 employs TSO as interactive and batch processing. TSO (Time Sharing Option) is used for interactive processing, allowing users to interact with the system in real-time. Batch processing, on the other hand, refers to the execution of a series of jobs without user interaction. It is commonly used for executing large volumes of repetitive tasks or processing data in bulk. In the context of DB2, batch processing allows for the efficient execution of scheduled jobs or the processing of large datasets without the need for constant user input.

    Rate this question:

  • 11. 

    Maximum number of tables that can be joined :

    • A.

      16

    • B.

      12

    • C.

      15

    • D.

      10

    Correct Answer
    C. 15
    Explanation
    The maximum number of tables that can be joined is 15. This means that in a database query, you can combine data from up to 15 different tables. Joining tables allows you to retrieve data from multiple tables based on a common column or key. By joining tables, you can create more complex and comprehensive queries that provide a more complete view of the data.

    Rate this question:

  • 12. 

     Cartesian product ‘ is the result of a join that does not specify matching columns.  (T\F).

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because a Cartesian product is the result of a join operation that does not specify any matching columns. In other words, it combines every row from one table with every row from another table, resulting in a combination of all possible pairs of rows. This can be useful in certain scenarios, but it can also lead to a large number of rows and potentially inefficient queries.

    Rate this question:

  • 13. 

     Group By does not do any sorting .         (T\F).

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because the Group By clause in SQL does not guarantee any specific order of the grouped data. It is used to group rows based on a specific column or expression, but it does not sort the data in any particular order. If sorting is required, an ORDER BY clause should be used in conjunction with the Group By clause.

    Rate this question:

  • 14. 

           The DBRM stands for______________________

    Correct Answer
    Data base request module
    Explanation
    The DBRM stands for Data base request module. It is a component of the DB2 database management system that contains the SQL statements and associated information for a specific application program. The DBRM is created during the precompile process and is used by the DB2 optimizer to generate an access plan for executing the SQL statements.

    Rate this question:

  • 15. 

     Which subquery operator compares a single value to every member of set of value.

    • A.

      IN

    • B.

      ANY

    • C.

      ALL

    • D.

      BETWEEN..AND

    Correct Answer
    B. ANY
    Explanation
    The correct answer is ANY. The ANY operator in a subquery compares a single value to every member of a set of values and returns true if any of the comparisons are true. It is commonly used with comparison operators such as =, >,

    Rate this question:

  • 16. 

     .    In EXIST operator when a match is found, the query ends processing for that row.        (T/F)  

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The explanation for the given correct answer is that the EXIST operator in a query is used to check if a subquery returns any rows. If a match is found, the query ends processing for that particular row and moves on to the next row. Therefore, when a match is found, the processing for that row is indeed ended, making the statement true.

    Rate this question:

  • 17. 

     GRANT SELECT ON EMPTAB TO USER  is a correct syntax (T/F)  

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given syntax "GRANT SELECT ON EMPTAB TO USER" is incorrect. The correct syntax for granting select permission on a table to a user in SQL is "GRANT SELECT ON table_name TO user_name". In this case, the table name is "EMPTAB" and the user name is missing. Therefore, the correct answer is False.

    Rate this question:

  • 18. 

     Performed for each row in the result table

    • A.

      Aggregate function

    • B.

      Scalar function

    • C.

      Group by

    • D.

      None of the above

    Correct Answer
    B. Scalar function
    Explanation
    A scalar function is a type of function in SQL that operates on a single value and returns a single value. It is used to perform calculations or transformations on individual values within a row. In this context, the scalar function is performed for each row in the result table, meaning that it is applied to each row individually rather than to a group of rows or the entire table. This distinguishes it from aggregate functions, which operate on a group of rows, and the group by clause, which is used to group rows together for aggregation purposes.

    Rate this question:

  • 19. 

     What is single bound DBRM with optimized access path .  

    • A.

      PLAN

    • B.

      PACKAGE

    • C.

      BIND

    • D.

      NONE

    Correct Answer
    B. PACKAGE
    Explanation
    A single bound DBRM refers to a package that contains a single DBRM (Database Request Module). This means that all the SQL statements within the package are compiled and optimized together, allowing for better performance and access path optimization. The optimized access path refers to the most efficient way for the database to retrieve and process the data requested by the SQL statements. Therefore, a single bound DBRM with optimized access path would result in improved performance and efficiency in executing SQL statements.

    Rate this question:

  • 20. 

    A DB2 storage group is a set of volume on a _______.

    Correct Answer
    DASD
    Explanation
    A DB2 storage group is a set of volumes on a DASD (Direct Access Storage Device). DASD is a type of storage device that allows direct access to data blocks, enabling fast and efficient retrieval and storage of data. By organizing volumes into storage groups, DB2 can effectively manage and allocate storage resources for database operations. This helps optimize performance and ensure data availability and reliability.

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

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.