Nothing Special   »   [go: up one dir, main page]

Open In App

Database Management Systems | Set 6

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 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]W1[X] W1[Y] W2[Y] 
Which of the above schedules are conflict-serializable? 
(A) S1 and S2 
(B) S2 and S3 
(C) S3 only 
(D) S4 only 

Answer (B) 
There can be two possible serial schedules T1 T2 and T2 T1. The serial schedule T1 T2 has the following sequence of operations 
R1[X] W1[X] W1[Y] R2[X] R2[Y] W2[Y] 
And the schedule T2 T1 has the following sequence of operations. 
R2[X] R2[Y] W2[Y] R1[X] W1[X] W1[Y] 
The Schedule S2 is conflict-equivalent to T2 T1 and S3 is conflict-equivalent to T1 T2. 

2) Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider 
the following queries on the database: 
 

 

IV) SELECT R.a, R.b
       FROM R,S
            WHERE R.c=S.c

Which of the above queries are equivalent? 
(A) I and II 
(B) I and III 
(C) II and IV 
(D) III and IV 

Answer (A) 
I and II describe the division operator in Relational Algebra and Tuple Relational Calculus respectively. See Page 3 of this and slide numbers 9,10 of this for more details. 

3) Consider the following relational schema: 

Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)

Consider the following relational query on the above database: 
 

SELECT S.sname
    FROM Suppliers S
        WHERE S.sid NOT IN (SELECT C.sid
                            FROM Catalog C
                            WHERE C.pid NOT IN (SELECT P.pid  
                                                FROM Parts P                                                                                                    
                                                WHERE P.color<> 'blue'))

Assume that relations corresponding to the above schema are not empty. Which one of the following is the correct interpretation of the above query? 

(A) Find the names of all suppliers who have supplied a non-blue part. 
(B) Find the names of all suppliers who have not supplied a non-blue part. 
(C) Find the names of all suppliers who have supplied only blue parts. 
(D) Find the names of all suppliers who have not supplied only blue parts. 

Answer (A) 
The subquery “SELECT P.pid FROM Parts P WHERE P.color<> ‘blue’” gives pids of parts which are not blue. The bigger subquery “SELECT C.sid FROM Catalog C WHERE C.pid NOT IN (SELECT P.pid FROM Parts P WHERE P.color<> ‘blue’)” gives sids of all those suppliers who have supplied blue parts. The complete query gives the names of all suppliers who have supplied a non-blue part 

4) Assume that, in the suppliers relation above, each supplier and each street within a city has a unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is TRUE about the above schema? 
(A) The schema is in BCNF 
(B) The schema is in 3NF but not in BCNF 
(C) The schema is in 2NF but not in 3NF 
(D) The schema is not in 2NF 

Answer (A) 
A relation is in BCNF if for every one of its dependencies X ? Y, at least one of the following conditions hold: 

    X ? Y is a trivial functional dependency (Y ? X)
    X is a superkey for schema R 

Since (sname, city) forms a candidate key, there is no non-trivial dependency X ? Y where X is not a superkey 

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.
 


Dreaming of M.Tech in IIT? Get AIR under 100 with our GATE 2026 CSE & DA courses! Get flexible weekday/weekend options, live mentorship, and mock tests. Access exclusive features like All India Mock Tests, and Doubt Solving—your GATE success starts now!


Next Article
Article Tags :

Similar Reads

Database Management Systems | Set 3
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)
3 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 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
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
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
RDBMS Full Form - Relational Database Management Systems
RDBMS stands for Relational Database Management Systems. A database is an organized collection of data stored in a computer system and usually controlled by a database management system (DBMS). The data in common databases is modeled in tables, making querying and processing efficient. What is RDBMS?RDBMS stands for Relational Database Management S
7 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
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
Structure of Database Management System
A Database Management System (DBMS) is software that allows users to define, store, maintain, and manage data in a structured and efficient manner. It acts as an intermediary between data and users, allowing disparate data from different applications to be managed. A DBMS simplifies the complexity of data processing by providing tools to organize d
8 min read