The Wayback Machine - https://web.archive.org/web/20241001121514/https://www.geeksforgeeks.org/database-management-system-set-3/
Open In App

Database Management Systems | Set 3

Last Updated : 13 Dec, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Following Questions have been asked in GATE 2012 exam.

1) Consider the following transactions with data items P and Q initialized to zero:

T1: read (P) ;
    read (Q) ;
    if P = 0 then Q : = Q + 1 ;
    write (Q) ;
T2: read (Q) ;
    read (P) ;
    if Q = 0 then P : = P + 1 ;
    write (P) ;

Any non-serial interleaving of T1 and T2 for concurrent execution leads to
(A) A serializable schedule
(B) A schedule that is not conflict serializable
(C) A conflict serializable schedule
(D) A schedule for which a precedence graph cannot be drawn

Answer (B)
Two or more actions are said to be in conflict if:
1) The actions belong to different transactions.
2) At least one of the actions is a write operation.
3) The actions access the same object (read or write).

The schedules S1 and S2 are said to be conflict-equivalent if the following conditions are satisfied:
1) Both schedules S1 and S2 involve the same set of transactions (including ordering of actions within each transaction).
2) The order of each pair of conflicting actions in S1 and S2 are the same.

A schedule is said to be conflict-serializable when the schedule is conflict-equivalent to one or more serial schedules.

Source: Wiki Page for Schedule

In the given scenario, there are two possible serial schedules:
1) T1 followed by T2
2) T2 followed by T1.
In both of the serial schedules, one of the transactions reads the value written by other transaction as a first step. Therefore, any non-serial interleaving of T1 and T2 will not be conflict serializable.



2) Consider the following relations A, B, C. How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A U B is the same as that of A.

Table A
Id   Name    Age
----------------
12   Arun    60
15   Shreya  24
99   Rohit   11


Table B
Id   Name   Age
----------------
15   Shreya  24
25   Hari    40
98   Rohit   20
99   Rohit   11


Table C
Id   Phone  Area
-----------------
10   2200   02  
99   2100   01

(A) 7
(B) 4
(C) 5
(D) 9

Answer (A)

Result of AUB will be following table

Id   Name    Age
----------------
12   Arun    60
15   Shreya  24
99   Rohit   11
25   Hari    40
98   Rohit   20

The result of given relational algebra expression will be

Id   Name    Age  Id   Phone Area
---------------------------------
12   Arun    60   10   2200   02 
15   Shreya  24   10   2200   02   
99   Rohit   11   10   2200   02 
25   Hari    40   10   2200   02 
98   Rohit   20   10   2200   02 
99   Rohit   11   99   2100   01
98   Rohit   20   99   2100   01



3) Consider the above tables A, B and C. How many tuples does the result of the following SQL query contains?

SELECT A.id 
FROM   A 
WHERE  A.age > ALL (SELECT B.age 
                    FROM   B 
                    WHERE  B. name = "arun") 

(A) 4
(B) 3
(C) 0
(D) 1

Answer (B)
The meaning of “ALL” is the A.Age should be greater than all the values returned by the subquery. There is no entry with name “arun” in table B. So the subquery will return NULL. If a subquery returns NULL, then the condition becomes true for all rows of A (See this for details). So all rows of table A are selected.

Please see GATE Corner for all previous year paper/solutions/explanations, syllabus, important dates, notes, etc.

Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.


Previous Article
Next Article

Similar Reads

Database Management Systems | Set 2
Following Questions have been asked in GATE 2012 exam. 1) Which of the following statements are TRUE about an SQL query? P: An SQL query can contain a HAVING clause even if it does not a GROUP BY clause Q: An SQL query can contain a HAVING clause only if it has a GROUP BY clause R: All attributes used in the GROUP BY clause must appear in the SELEC
4 min read
Database Management Systems | Set 4
Following Questions have been asked in GATE 2011 exam. 1. Consider a relational table with a single record for each registered student with the following attributes. 1. Registration_Number:< Unique registration number for each registered student 2. UID: Unique Identity number, unique at the national level for each citizen 3. BankAccount_Number:
4 min read
Database Management Systems | Set 5
Following Questions have been asked in GATE CS 2010 exam. 1) A relational schema for a train reservation database is given below. Passenger (pid, pname, age) Reservation (pid, class, tid) Table: Passenger pid pname age ----------------- 0 Sachin 65 1 Rahul 66 2 Sourav 67 3 Anil 69 Table : Reservation pid class tid --------------- 0 AC 8200 1 AC 820
4 min read
Database Management Systems | Set 6
Following questions have been asked in GATE 2009 CS exam. 1) Consider two transactions T1 and T2, and four schedules S1, S2, S3, S4 of T1 and T2 as given below: T1 = R1[X] W1[X] W1[Y] T2 = R2[X] R2[Y] W2[Y] S1 = R1[X] R2[X] R2[Y] W1[X] W1[Y] W2[Y] S2 = R1[X] R2[X] R2[Y] W1[X] W2[Y] W1[Y] S3 = R1[X] W1[X] R2[X] W1[Y] R2[Y] W2[Y] S1 = R1[X] R2[Y]R2[X
4 min read
Database Management Systems | Set 7
Following questions have been asked in GATE 2008 CS exam. 1) Let R and S be two relations with the following schema R (P,Q,R1,R2,R3) S (P,Q,S1,S2) Where {P, Q} is the key for both schemas. Which of the following queries are equivalent? (A) Only I and II (B) Only I and III (C) Only I, II and III (D) Only I, III and IV Answer (D) In I, Ps from natura
3 min read
Database Management Systems | Set 10
Following questions have been asked in GATE CS 2005 exam. 1) Let r be a relation instance with schema R = (A, B, C, D). We define r1 = 'select A,B,C from r' and r2 = 'select A, D from r'. Let s = r1 * r2 where * denotes natural join. Given that the decomposition of r into r1 and r2 is lossy, which one of the following is TRUE? (a) s is subset of r
3 min read
Database Management Systems | Set 8
Following questions have been asked in GATE 2005 CS exam. 1) Which one of the following statements about normal forms is FALSE? (a) BCNF is stricter than 3NF (b) Lossless, dependency-preserving decomposition into 3NF is always possible (c) Lossless, dependency-preserving decomposition into BCNF is always possible (d) Any relation with two attribute
3 min read
Database Management Systems | Set 9
Following questions have been asked in GATE 2006 CS exam. 1) Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest. 1. T1 start 2. T1 B old=12000 new=10000 3. T1 M old=0 new=2000 4. T1 commit 5. T2 start 6. T2 B old=10000 new=10500
4 min read
Database Management Systems | Set 11
Following questions have been asked in GATE CS 2007 exam. 1) Information about a collection of students is given by the relation studinfo(studId, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for (or taken) that course(s). Assume that every course is taken by at least one male and at least one female student. Wh
5 min read
Types of Database Management Systems
A Database Management System (DBMS) is a software system that is designed to manage and organize data in a structured manner. It allows users to create, modify, and query a database, as well as manage the security and access controls for that database. What is DBMS?A DBMS (Database Management System) is a software or technology used to manage data
5 min read
Difference between Operational Systems and Informational Systems
1. Operational Systems : An operational system is a generally known term in data warehousing that specifies a system which is used to maintain records of daily business transactions in an organization. Operational system is also termed as Online Transaction Processing (OLTP). Operational systems have to deal with the running data values and consist
3 min read
Intrusion Detection Systems (IDS) vs Intrusion Prevention Systems (IPS)
It is difficult to make Internet use secure in current situation, people are the among the most important aspect. The two kinds of network security instruments that are applied to protect against cyber threat dangers are Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) thus forming a comprehensive scheme of cyber safeguards.
4 min read
Applications of Commercial Deductive Database Systems
A Deductive Database is a type of database that can make conclusions or we can say deductions using a sets of well defined rules and fact that are stored in the database. In today's world as we deal with a large amount of data, this deductive database provides a lot of advantages. It helps to combine the RDBMS with logic programming. To design a de
3 min read
Differences between Operational Database Systems and Data Warehouse
The Operational Database is the source of data for the information distribution center. It incorporates point by point data utilized to run the day to day operations of the trade. The information as often as possible changes as upgrades are made and reflect the current esteem of the final transactions. Operational Database Administration Frameworks
3 min read
Date's Twelve Rules for Distributed Database Systems
Distributed databases brings advantages of distributed computing which consists huge number of processing elements, elements may be heterogeneous. Elements are connected with network which help in performing the assigned task. Basically, it is used to solve problem by distributing it into number of smaller problems and solve smaller problems in coo
3 min read
How do Database Systems Handle Transaction Failures?
Answer: Database systems handle transaction failures through two mechanisms, rollback and logging.Database systems handle transaction failures by leveraging the ACID (Atomicity, Consistency, Isolation, Durability) properties to ensure data integrity and system reliability. When a transaction fails, the system employs two critical mechanisms: rollba
1 min read
Difference Between Single User and Multi User Database Systems
Databases are used in organizing, storing, and retrieving data for various purposes in different categories of uses range from personal uses to large business uses. There are two ways to classify database systems that are the number of users allowed to access and modify the data concurrently. Principal distinctions are based on the number of users
8 min read
How to pre populate database in Android using SQLite Database
Introduction : Often, there is a need to initiate an Android app with an already existing database. This is called prepopulating a database. In this article, we will see how to pre-populate database in Android using SQLite Database. The database used in this example can be downloaded as Demo Database. To prepopulate a SQLite database in an Android
7 min read
Difference between Database Administrator and Database Architect
In the field of data management the position of a DBA and that of a Database Architect while sounding similar are in fact quite distinct. Although both jobs are crucial for maintaining the functionality and the protection of databases, both jobs engaged on various tasks connected with database management. A DBA is mainly involved in database admini
5 min read
Difference between Open Source Database and Commercial Database
Databases play a critical role in storing and managing structured data, with the help of a Database Management System (DBMS). They are broadly categorized into two types: open-source and commercial. Open-source databases, like MySQL and PostgreSQL, are freely available and allow customization, making them a popular choice for budget-conscious organ
6 min read
Difference between Database Administrator (DBA) and Database Engineer
Database Administrator is a user who is responsible for all duties related to the database like performance, optimization, backup, recovery, etc. Whereas the Data Engineer is the user who is responsible for developing the databases and he/she must ensure the proper functioning of the database. This article will provide an in-depth guide about the m
5 min read
Difference between Centralized Database and Distributed Database
As we know, databases are widely used for efficient storage, search, and other operations with data in the process of data management. Listening to the experience of using databases, two major categories are Centralized Databases and Distributed Databases. It is crucial to grasp the distinctions between these two types since every one of them posse
6 min read
Database Management System - GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
5 min read
SQL Trigger | Book Management Database
Prerequisite - SQL Trigger | Student Database For example, given Library Book Management database schema with Student database schema. In these databases, if any student borrows a book from library then the count of that specified book should be decremented. To do so, Suppose the schema with some data, mysql> select * from book_det; +-----+-----
2 min read
Federated database management system issues
What is a Federated Database Management System? A Federated Database Management System (FDBMS) is a type of distributed database management system that allows users to access and manipulate data stored in multiple databases. It is a system that integrates data from different sources, providing a single view of the data to users. This type of system
9 min read
Data Management issues in Mobile database
Data management technology that can support easy data access from and to mobile devices is among the main concerns in mobile information systems. Mobile computing may be considered a variation of distributed computing. The two scenarios in which mobile databases is distributed are: Among the wired components, the entire database is distributed, pos
7 min read
Perl | Database management using DBI
Prerequisites: Introduction to Perl Database Systems Creating database programs is one of the most common uses of Perl. Using Perl, we can create robust web applications along with a database to manage all the data. It provides excellent support for interfacing and a broad range of database formats. For connecting to and querying a database, Perl p
7 min read
Personnel involved in Database Management System
Many persons are involved in the design, use, and maintenance of a large database with a few hundred users. Here we will consider people who may be called "Actors on the Scene", whose jobs involve the day-to-day use of a large database. Database Administrators: Administrating the primary (database) and secondary (DBMS and related software) is the r
5 min read
Database Management System | Dependency Preserving Decomposition
Dependency Preservation: A Decomposition D = { R1, R2, R3...Rn } of R is dependency preserving wrt a set F of Functional dependency if (F1 ? F2 ? … ? Fm)+ = F+. Consider a relation R R ---> F{...with some functional dependency(FD)....} R is decomposed or divided into R1 with FD { f1 } and R2 with { f2 }, then there can be three cases: f1 U f2 =
4 min read
Advantages of Database Management System
Database Management System (DBMS) is a collection of interrelated data and a set of software tools/programs that access, process, and manipulate data. It allows access, retrieval, and use of that data by considering appropriate security measures. The Database Management system (DBMS) is really useful for better data integration and security. Advant
5 min read
Article Tags :