Академический Документы
Профессиональный Документы
Культура Документы
Question bank
Database management system(Ec705c)
Group-A
Multiple Choice Questions:
Module-I: Introduction to DBMS
1. What is the name of the system database that contains descriptions of the data in the
database?
a) Metadata b) Data dictionary c) Table d) None of the above
2. What represent a correspondence between the various data elements?
a) Data b) Relationships c) Constraints d) Schema
3. The collection of data stored in a database at a particular moment is called the
a) relation b) schema c) instance d) none of these
4. What is refined data?
a) Knowledge b) Information c) Statistics d) None of the above
5. According to the levels of abstraction, the schema at the intermediate level is called
a) Logical schema. b) Physical schema. c) Subschema. d) Super schema.
6. Which database level is the one closest to the users?
a) Physical c) External d) Conceptual
7. Which database level is the one closest to the physical storage?
a) Physical c) External d) Conceptual
8. Data structure of the data stored in a database is dealt by
a) external schema b) conceptual schema c) internal schema d) varies with differ-
ent databases
9. The ability to change the conceptual schema without having to change external
schema is
a) logical data independence b) physical data independence
c) three schema architecture d) sub-schema
10. View is a
a) virtual relation b) temporary relation c) dynamic relation d) all of these
11. Which of the following is a characteristic of the data in a database?
a) Shared b) Secure c) Independent d) All of the above
12. Which of the following is a database element?
a) Data b) Relationships c) Constraints and schema d) All of the
above
13. What are binary computer representations of stored logical entities?
a) Data b) Relationships c) Constraints d) Schema
14. One of the shortcomings of the system is
a) data availability b) fixed records c) sequential records d) lack of security
15. Blocking factor is
a) blocks fetched per sector b) blocks fit into sectors
c) tuples fit per block d) blocks for storing a relation
16. What is data integrity?
a) It is the data contained in database that is non redundant.
b) It is the data contained in database that is accurate and consistent.
c) It is the data contained in database that is secured.
d) It is the data contained in database that is shared
17. IMS stands for ___________.
a) Information Management System b) Internal Mechanical Security
c) International Managers Society d) None of the above
18. Which of the following is a hierarchical database?
Question Bank_EC705C
Page 1
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 2
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
16. What is a relationship called when an association is maintained between four enti -
ties?
a) Unary b) Binary c) Ternary d) Quaternary
17. Which of the following indicates the maximum number of entities that can be
involved in a relationship?
a) Minimum cardinality b) Maximum cardinality c) ERD d) Greater Entity
Count
18. In the relational model, cardinality is termed as
a) number of tuples b) number of attributes c) number of tables d) number of
constraints
19. Cardinality ratio means
a) number of attributes associated with an entity
b) number of entity related with other entity via a relationship
c) both (a) and (b)
d) none of these
20. Which type of entity cannot exist in the database unless another type of entity also
exists in the database, but does not require that the identifier of that other entity be
included as part of its own identifier?
a) Weak entity b) Strong entity c) ID-dependent entity d) ID-
independent entity
21. In a one-to-many relationship, the entity that is on the one side of the relationship is
called a(n) ________ entity.
a) parent b) child c) instance d) subtype
22. Which type of entity represents an actual occurrence of an associated generalized
entity?
a) Super type entity b) Subtype entity c) Archetype entity d)
Instance entity
23. A recursive relationship is a relationship between an entity and ________.
a) itself b) a subtype entity c) an archetype entity d) an instance
entity
24. Which of the following refers to something that can be identified in the users' work
environment, something that the users want to track?
a) Entity b) Attribute c) Identifier d) Relationship
25. In which of the following is a single-entity instance of one type related to many entity
instances of another type?
a) One-to-One Relationship b) One-to-Many Relationship
c) Many-to-Many Relationship d) Composite Relationship
26. Which of the following refers to an entity in which the identifier of one entity includes
the identifier of another entity?
a) Weak entity b) Strong entity c) ID-dependent entity d) ID-independent
entity
27. Which type of entity is related to two or more associated entities that each contain
specialized attributes that apply to some but not all of the instances of the entity?
a) Super type entity b) Subtype entity c) Archetype entity d) Instance
entity
28. An attribute that names or identifies entity instances is a(n)
a) entity. b) attribute. c) identifier. d) relationship.
29. The set of permitted values of an attribute is called its
a) tuple b) domain c) relation d) none of these
30. Properties that describe the characteristics of entities are called:
a) entities. b) attributes. c) identifiers. d) relationships.
Question Bank_EC705C
Page 3
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
31. In which of the following can many entity instances of one type be related to many
entity instances of another type?
a) One-to-One Relationship b) One-to-Many Relationship
c) Many-to-Many Relationship d) Composite Relationship
Question Bank_EC705C
Page 4
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 6
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 7
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
19. Which of the following keys in a table can uniquely identify a row in a table?
a) Candidate key b) Primary key c) Alternate key d) All of the above
20. A table can have only one
a) Candidate key b) Primary key c) Alternate key d) All of the above
21. Which key cannot be null
a) Foreign key b) Primary key c) Super key d) Unique key
22. In case of entity integrity, the primary key may be
a) not Null b) Null c) both Null & not Null d) any value
23. NULL stands for
a) zero b) space c) garbage d) absence of any value
24. An attribute of one table matching the primary key of another table is called
a) candidate key b) secondary key c) foreign key d) composite key
25. All candidate keys other than the primary keys are called
a) Secondary keys b) Alternate keys c) Eligible keys d) None of the
above
26. What is the name of the attribute or attribute combination of one relation whose
values are required to match those of the primary key of some other relation?
a) Primary key b) Candidate key c) Matching key d) Foreign key
27. A discriminator is also called
a) partial key b) super key c) foreign key d) primary key
28. Which of the following is an integrity constraint?
a) Domain constraint b) Entity integrity c) Referential integrity d) All of the
above
29. Which of the following is pan of a domain definition?
a) Domain name b) Data type c) Size d) All of the above
30. The rule that a value of a foreign key must appear as a value of some specific table
is called a
a) Referential constraint. b) Index. c) Integrity constraint. d) Functional
dependency.
31. In relational model, each tuple contains values for –
a) attributes b) entities c) relationships d) domains
Question Bank_EC705C
Page 8
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
5. Which of the following process involves analysis and identification of data that must
be stored and how best 10 store it?
a) Normalization b) Denormalization c) Information modeling d) All of the
above
6. Which of the following is a formal process of developing data structures in a manner
that eliminates redundancy and promotes integrity?
a) Normalization b) Compilation c) Performance Tuning d) Information Model -
ing
7. What is the expansion of BCNF?
a) Boyd-Cromwell Normal Form b)Boyce-Codd Normal Form
c) Boyd-Codd Normal Form d) None of the above
8. When all the columns in a table describe and depend upon the primary key, the table
is said to satisfy the normal form.
a) First b) Second c) Third d) Fourth
9. A normal form in which every non prime attribute is fully dependent on prime at -
tribute is
a) 1NF b) 2NF c) 3NF d) BCNF
10. Transitive dependency is removed in
a) 1NF b) 2NF c) 3NF d) 4NF
11. Which of the following is a column in a table that uniquely identifies the records from
a different table?
a) Primary Key b) Candidate Key c) Foreign Key d) Intelligent Key
12. Which of the following is true?
a) Superkey is always a candidate key
b) Every 3NF schema is also in BCNF
c) Generalization is top-down design approach
d) none of these
Module-VI: Internals of RDBMS
1. Serializability of concurrent transactions are ensured by
a) locking b) time stamping c) both (a) and (b) d) none of these.
2. Check pointing is associated with
a) log based recovery
b) non-log based recovery
c) both (a) and (b)
d) none of these.
3. 2PL is a
a) concurrency control technique
b) recovery mechanism
c) deadlock prevention mechanism
d) none of these.
4. Which of the following is not a recovery technique?
a) Shadow-paging b) Deferred updating c) Write-Ahead logging d) Immediate
updating
5. Which of the following situations is detected by a Precedence graph?
a) Deadlock b) Serializability c) Redundancy d) Functional de-
pendency.
6. A transaction is said to be atomic, if and only if
a) transaction is partially completed
Question Bank_EC705C
Page 9
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 10
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Group-B
WBUT Questions:
Question Bank_EC705C
Page 11
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
30. Compare and contrast the hierarchical, network and object-oriented database mod-
els.
17. What are super class entity types? Explain with examples.
18. What are subclass entity types? Explain with examples.
19. How are super classes and sub class entity types related?
20. What is specialization?
21. What is generalization?
22. What is a one-to-one relationship? Give examples.
23. What is a one-to-many relationship? Give examples.
24. What is a many-to-many relationship? Give examples.
25. What is a composite attribute? Explain with an example.
26. Draw the E-R diagram of a library using the different components of E-R models.
27. Construct an E-R diagram for a car-insurance company whose customers own one or
more cars each. Each car has associated with it zero to any number of recorded acci-
dents.
28. Construct an E-R diagram for a hospital with a set of patients and a set of medical
doctors. Associate with each patient a log of the various tests and examinations con-
ducted.
29. Consider the E-R diagram in Figure 2.10, which models an online bookstore.
a) List the entity sets and their primary keys.
Question Bank_EC705C
Page 12
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
b) Suppose the bookstore adds music cassettes and compact disks to its collection.
The same music item may be present in cassette or compact disk format, with dif -
fering prices. Extend the E-R diagram to model this addition, ignoring the effect on
shopping baskets.
c) Now extend the E-R diagram, using generalization, to model the case where a
shopping basket may contain any combination of books, music cassettes, or com-
pact disks.
30. Design an E-R diagram for keeping track of the exploits of your favorite sports team.
You should store the matches played, the scores in each match, the players in each
match and individual player statistics for each match. Summary statistics should be
modeled as derived attributes.
31. An E-R diagram can be viewed as a graph. What do the following mean in terms of
the structure of an enterprise schema?
a) The graph is disconnected.
b) The graph is acyclic.
32. a) Construct an ER diagram for a hospital with a set of doctors and set of patients.
Associate with each patient a log of examinations conducted. A patient can see more
than one doctor and a doctor can have more than one patient. A patient should see at
least one doctor and a doctor should have at least one patient. Patient have log and
doctor studies log for deciding treatment. These are minimum details that you should
specify, but it’s upto you- what else you can add to ERD to make it more comprehen-
sive. i) Document all assumptions that you make about the mapping con-
straints, participation, key etc. ii) Write your opinion regarding ‘log’ used as an
entity set and ‘log’ used as an attribute.
Convert them into ER diagram.
b) Also draw another ER diagram having the ternary relationship between the
relations.
Which ER diagram is better to you? State why according to your view.
33. A university registrar’s office maintains data about the following entities:
(a) courses, including number, title, credits, syllabus, and prerequisites;
(b) course offerings, including course number, year, semester, section number, in-
structor(s), timings, and classroom;
(c) students, including student-id, name, and program; and
(d) instructors, including identification number, name, department, and title.
Further, the enrollment of students in courses and grades awarded to students in
each course they are enrolled for must be appropriately modeled.
Construct an E-R diagram for the registrar’s office. Document all assumptions that
you make about the mapping constraints.
34.Draw and Explain the E-R diagram of Banking System with the help of a neat sketch.
35.Design a Generalization-Specialization hierarchy for a motor vehicle sales company.
The company sells motor-cycles, passenger cars, vans, buses. Justify your placement
of attributes at each level of the hierarchy. Explain why they should not be placed at
a higher or lower level.
Question Bank_EC705C
Page 13
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
23. What do you mean by query optimization? Estimate the size for following conjunctive
Question Bank_EC705C
Page 14
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
(iii) Print the total trip expenses incurred by the salesman with SSN =‘234-56-7890’.
29. Consider the schema
Airport (code, name, city, country)
Flight (number, airline, from_airport_code, to_airport_code)
Reservation(flight_number, seat_number, date, passenger_name)
Answer the following using relational algebra
(i) List the flight numbers of flights that take off from India
(ii) List the passenger who are on flight number ‘SA 747’.
(iii) List all the flight information for Indian Airlines and Jet Airways.
30. Consider the database below(primary keys are underlined):
Sailors(sid, sname, rating, age)
Boats(bid, bname, color)
Reserves(sid, bid, day)
Express the following queries in relational algebra:
(i) Find sailors who have reserved boat no.101
(ii) Find names of sailors who have reserved a green boat but not red boat.
(iii) Find sids of sailors who have rating of 10 or have reserved boat 102.
(iv) Find names and sids of sailors who have reserved all green boats
31. Consider the following schema of a relational database
Employee (e.no , name address )
Project (p.no , p_name )
Work-on(e_no, p_no)
Part (part_no,part_name ,qty_on_hand, size)
Use(e_no, p_no, part_no, number)
Solve the following queries using relational Algebra.
a) Print the names of the employees who are working on a project name ‘DBMS’
b) Print the names of all employees where are not working in any project.
c) List the names of the employees and the projects with which the employees
are associated with and for which they have used no part so far.
d) List the names of the projects , such that every employee working on these
projects has used a part ‘bolts’ with size ‘6’
e) List the part number & part names used in both projects ‘DBMS’ and ‘MIS’
f) List the names of all employees who are working in both the project ‘DBMS’
and ‘MIS’
32. Consider the following tables:
Employee
Emp_Na Street City
me
Coyote Toon Hollywoo
d
Rabote Tunnel Carrotvill
e
Smith Revolver Jaannom
William Seaview Seattle
Works
Emp_Nam Branch Salary
e
Coyote Mesa 15000
Rabote Mesa 13000
Question Bank_EC705C
Page 15
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Show the result for their natural join, left outer Join, right outer join, full outer join
33. Consider the following relational database , where the primary keys are underlined.
employee (person-name, street, city)
works (person-name, company-name, salary)
company (company-name, city)
manages (person-name, manager-name)
34. Consider the above relational database. Give a relational-algebra expression for each
of the following queries:
a) Find the company with the most employees.
b) Find the company with the smallest payroll.
c) Find those companies whose employees earn a higher salary, on average, than the
average salary at First Bank Corporation.
35. Specify the following queries on the COMPANY relational database schema given be-
low.
Employee (Fname, Minit, Lname, SSn, Bdate, Address, Sex, Salary, Super_ssn, Dno)
Department (Dname, Dnumber, Mgrssn, Mgr_startdate)
Dept_location (Dnumber, Dlocation)
Project (Pname, Pnumber, Plocation, Dnum)
Works_on (essn, pno, hours)
Dependent (essn, dependent_name, sex, bdate, Relationship)
(a) Retrieve the names of employees in department 5 who work more than 10 hours per
week on the 'ProductX' project.
(b) List the names of employees who have a dependent with the same first name as
themselves.
Question Bank_EC705C
Page 16
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
(c) Find the names of employees that are directly supervised by 'Franklin Wong'.
(d) For each project, list the project name and the total hours per week (by all
employees) spent on that project.
(e) Retrieve the names of employees who work on every project.
(f) Retrieve the names of employees who do not work on any project.
(g) For each department, retrieve the department name, and the average salary of
employees working in that department.
(h) Retrieve the average salary of all female employees.
(i) Find the names and addresses of employees who work on at least one project located
in Houston but whose department has no location in Houston.
(j) List the last names of department managers who have no dependents.
36. Consider the LIBRARY relational schema shown below, which is used to keep track of
books, borrowers, and book loans. Referential integrity constraints are shown as di-
rected. Write down relational expressions for the following queries on the LIBRARY
database:
(a) How many copies of the book titled The Lost Tribe are owned by the library branch
whose name is "Sharpstown"?
(b) How many copies of the book titled The Lost Tribe are owned by each library branch?
(c) Retrieve the names of all borrowers who do not have any books checked out.
(d) For each book that is loaned out from the "Sharpstown" branch and whose Due Date
is today, retrieve the book title, the borrower's name, and the borrower's address.
(e) For each library branch, retrieve the branch name and the total number of books
loaned out from that branch.
(f) Retrieve the names, addresses, and number of books checked out for all borrowers
who have more than five books checked out.
(g) For each book authored (or co-authored) by "Stephen King", retrieve the title and the
number of copies owned by the library branch whose name is "Central".
37. What is relational calculus?
38. In what sense does relational calculus differ from relational algebra and in what
sense are they similar?
39. What is tuple relational calculus?
40. How does tuple relational calculus differ from domain relational calculus?
41. When is a query language called relationally complete?
42. What additional features of commercial query languages over and above those nec-
essary for relational completeness?
43. What do you mean by expressive power?
44. What is a tuple variable?
45. What is the truth value or an atom?
46. What is a formula?
Question Bank_EC705C
Page 17
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 18
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
(v) Update the damage amount for the car with registration no “AABB2200”
in the accident
37. Consider the supplies-parts-projects database mentioned below:
S(S#, SNAME, STATUS, CITY, primary key S#)
P(P#,PNAME,COLOR,WEIGHT,CITY, Primary key P#)
J(J#,JNAME,CITY, primary key J#)
SPJ(S#,P#,J#,QUANTITY, primary key (S#,P#,J#),foreign key S# references S , foreign
key P# references P , foreign key J# references J)
Write SQL statements to answer the following queries
i) Get full details of all projects In London.
ii) Get full details of parts supplied by a supplier in London.
iii) Get part numbers or parts supplied to a project by a supplier in the same city as
the project.
iv) Get part numbers of parts supplied to some project in an average quantity of more
than 350.
v) Get project numbers for projects not supplied with any red part by any London
supplier.
38. Consider the following relation schema of Library.
Book (book-id, title)
Author (book-id, author-name)
Book-copies (Book-id, branch-id, no-of-copy)
Library-branch (branch-id, branch-name)
Book-loan (book-id, branch-id, card-no)
Borrower (card-no, name, city)
Write the following queries using SQL.
i) List the name of books borrowed by the borrowers who reside in KOLKATA.
ii) Retrieve the names of borrowers who do not borrow any book.
iii) Retrieve the name of the Library branches which have maximum number of books.
iv) Retrieve the name of borrowers who have borrowed at least 3 books and not more
than 10 books.
Question Bank_EC705C
Page 19
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 20
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
60. Consider the relation schema EMP_DEPT (Ename, Ssn, Bdate, Addr, Dnum, Dname,
Dmgrssn) and the following set G of functional dependencies on EMP_DEPT:
G = {SSN → {ENAME, BDATE, ADDRESS, DNUMBER} , DNUMBER → {DNAME, DM-
GRSSN} }.
Calculate the closures {SSN} + and {DNUMBER} + with respect to G.
61. What update anomalies occur in the EMP_PROJ (Ssn, Project_number, hours, ename,
pname, plocation) and EMP_DEPT (Ename, Ssn, Bdate, Addr, Dnum, Dname, Dm-
grssn) relations with the FDs
F={{SSN, PNUMBER} → HOURS, SSN → ENAME, SSN → {PNAME, PLOCATION}
and
G = {SSN → {ENAME, BDATE, ADDRESS, DNUMBER} , DNUMBER → {DNAME, DM-
GRSSN} }?
62. Consider the universal relation R = {A, B, C, D, E, F, G, H, I} and the set of func -
tional dependencies
F = { {A, B} → {C}, {A} → {D, E}, {B} → {F}, {F} → {G, H}, {D} → {I, J} }.
What is the key for R? Decompose R into 2NF, then 3NF relations.
63. Given relation R (A,B,C,D,E) with dependencies AB → C, CD → E, DE → B is AB a
candidate key of this relation? If not, is ABD? Explain your answer.
64. Show that AB→ D is in the closure of F={AB → C, CE → D, A → E}.
65. CAR_SALE (CarID, Option_type, Option_Listprice, Sale_date, Discounted_price)
This relation refers to options installed on cars (e.g.- cruise control) that were sold at a
dealership and the list and discounted prices for the options. If CarID → Sale_date and
Option_type→ Option_Listprice, and
CarID, Option_type → Discounted_price, are the functional dependencies.
a) Argue from your knowledge of 2NF, why it is not in 2NF.
b) Is it in 3NF? If not, convert it into 3NF.
c) Consider the above relation CAR_SALE is decomposed into the following rela-
tions:
ACTUAL_OPTION_PRICING (CarID, Option_type, Discounted_price)
CAR (CarID, Sale_date )
OPTION (Option_type, Option_Listprice )
Determine if this decomposition is indeed lossless.
6. What is a cascadeless schedule? Why is it required? Are there any circumstances un-
der which it would be desirable to allow noncascadeless schedule? Explain.
7. Consider the following precedence graph:
T1 T2
T4 T3
T5
Is the corresponding schedule conflict serializable? Explain your answer.
Group-C
GATE Level & Conceptual Questions:
Module-I: Introduction to DBMS
1. Explain the distinction between disjoint and overlapping constraints in the context of
specialization and
generalization. Marks: 4 Time: 7
min
Question Bank_EC705C
Page 23
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
2. A weak entity set can always be made into a strong entity set by adding to its at-
tributes the primary key attributes of its identifying entity set. Outline what sort of re -
dundancy will result if we do so.
Marks: 2 Time: 5 min
3. Consider the following ER diagram. If A has 100 entities, B has 1000 entities and C
has 10 entities what is the maximum number of entities (A, B, C) that could be in the
ternary relationship set R? Explain.
Marks: 3 Time: 6 min
4. List down the differences between an active and passive data dictionary?
Marks: 4 Time:6 min
Module-II: Entity-Relationship Model
1. Consider the following information about a university database:
a) Professors have an id, name, an age, a rank and a research area.
b) Projects have a project number, a budget, a start date and a finish date.
c) Under graduate students have an id, name, age, a course.
d) Each project is managed by one professor, called Principal Investigator.
e) One or more professors called Co-investigators work each project on.
f) When graduate students work ona project, a professor must supervise their
work.
g) Graduate students can work on a multiple projects in which case they will have
different supervisor for each one.
h) Departments have a dept number, name and an office. One professor is an
HOD of a department.
Design a ER diagram for the above system. Your diagram should specify enti-
ties, relationships, different types of attributes, keys, mapping cardinalities,
roles etc. Marks: 8 Time: 15 min
2. Consider a database that is to represent a large business. In this typical business,
there is a Division that operates several Departments. The Division is run by one Em -
ployee and each Department is managed by one Employee. Of course the Depart-
ment employs many Employees who work on projects that are assigned to them. Ev-
eryone needs to be busy, so it is not uncommon for an Employee to be assigned
many Projects and a Project may have many Employees assigned to it. There is a
special case of Employees that are not assigned to any Department; they roam
around looking for work from the various Departments. The task is to create an ERD
that represents this business situation. Marks: 8 Time: 15 min
3. Use the numbered points of information (requirement specification) to draw an En -
tity-Relationship (E-R) diagram for a system to hold information on Oscar awards. Your
E-R diagram should show ENTITIES, RELATIONSHIPS AND PK FIELDS ONLY in addition
to the justification for each side of each relationship by adding comments to the dia-
gram. The diagram has been started using the points below.
a) A film has many roles.
b) Each role is cast in 1 film
c) Each role is nominated for many awards
Question Bank_EC705C
Page 24
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
d) Each award has many roles nominated to receive it. The year of nomination is
recorded and whether or not it was successful.
Marks: 6 Time: 12 min
4. Consider the following ERD.
Marks: 8 Time: 18
min
Question Bank_EC705C
Page 25
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Write down the following queries using relational algebra. You may use any valid algebra
expression. Make sure you rename attributes whenever selection conditions are
ambiguous.
I. Find all parts with available quantity greater than 1000 or are supplied by a coun-
try in ’East Asia’
geographic region. Return the name of the part.
II. Find all suppliers who do not supply any parts with retail price greater than 1,000.
Return the name of
the suppliers. Marks: 3+3 Time: 10 min
2. Consider the following schema of a company database:
Employees (eid: integer, ename: string, address: string, supereid: integer)
Departments (did: integer, dname: string)
Projects (pid: integer, pname: string, did: integer)
Works_on (eid: integer, pid: integer, hours: integer)
Each Employee has a supervisor (another Employee) referenced by his/her supereid.
Projects are uniquely assigned to a Department. The Works_on relation records which
Employee works on which Project for how many hours a week.
Formulate each of the following queries in relational algebra (RA).
I. For each Employee, find his / her name and the name of his / her supervisor.
II. Find the eids of Employees who work on a project of every Department, i.e. find
the eids of Employees who work for (a project of) every Department.
Marks: 3+3 Time: 10 min
3. Given two relations R1 and R2, where R1 contains N1 tuples, R2 contains N2 tuples,
and N2> N1> 0, give the min and max possible sizes for the resulting relational
algebra expressions:
R1 U R2, R1 ∩ R2, R1 X R2, σ (a=5) (R1), ∏ a (R1), R1 (JOIN) R2 , where a is an at-
tribute of R1.
Marks: 2X 6 Time: 15 min
4. Consider the employee relation:
EMP (eid, ename, addr, salary, dept)
a. Use tuple relational calculus to retrieve the name and address of all employees
who work for ‘research’ department.
b. Use relational algebra to find the employee with highest salary. Marks:
3+3 Time: 10 min
5. Consider the following relational database:
Hotel (hid, hname, haddr, hcity)
Question Bank_EC705C
Page 26
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Question Bank_EC705C
Page 27
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
ii) Find the names of all employees who live in the same city and on the same street as
do their managers.
iii) Find the names of all employees who earn more than every employee of ‘Aije Bank
Ltd’.
iv) Find all companies located in every city in which ‘Rural Bank (India)’ is located.
v) Give the managers a 10 percent salary raise, whose salary is greater than 50000 and
for others, give only a 3 percent raise.
vi) Find the company that has the most employees
vii) Find those companies whose employees earn a higher salary, on average, than the
average salary at First Bank Corporation.
viii) Find the company that has the smallest payroll.
ix) Give all managers of First Bank Corporation a 10-percent raise. Marks:2X9
Time: 2-3 min each
2. The following relations keep track of airline flight information:
Flights (flno: integer, from: string, to: string, distance: integer, departs: time, arrives:
time, price: integer)
Aircraft (aid: integer, aname: string, cruising_range: integer)
Certified (eid: integer, aid: integer)
Employees (eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well;
every pilot is certified for some aircraft, and only pilots are certified to fly. Write each of
the following queries in SQL.
a) Find the names of aircraft such that all pilots certified to operate them earn more
than $80,000.
b) For each pilot who is certified for more than three aircraft, find the eid and the maxi -
mum cruising_range of the aircraft for which she or he is certified.
c) Find the names of pilots whose salary is less than the price of the cheapest route
from Los Angeles to Honolulu.
d) For all aircraft with cruising_range over 1000 miles, find the name of the aircraft and
the average salary of all pilots certified for this aircraft.
e) Find the names of pilots certified for some Boeing aircraft.
f) Find the aids of all aircraft that can be used on routes from Los Angeles to Chicago.
g) Identify the routes that can be piloted by every pilot who makes more than
$100,000.
h) Print the enames of pilots who can operate planes with cruising_range greater than
3000 miles but are not certified on any Boeing aircraft.
i) A customer wants to travel from Madison to New York with no more than two changes
of flight. List the choice of departure times from Madison if the customer wants to ar-
rive in New York by 6 p.m.
j) Compute the difference between the average salary of a pilot and the average salary
of all employees (including pilots) Marks:2 X
10 Time: 2-3 min each
3. Consider the following relations and write down expressions for the following queries:
EMP ( eid, ename, age, address, salary )
Works ( eid, did, hours )
Dept ( did, dname, managerid )
i) List the name of employees who work for the ‘Research’ department for 8 hours using
Relational Algebra.
ii) List name and address of all employees with department number 5 using Relational
Calculus
Question Bank_EC705C
Page 28
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
iii) Fine the managerid of managers who manage only departments with budgets greater
than 1 lac using SQL.
iv) Find the employee who has highest salary using SQL.
Question Bank_EC705C
Page 29
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
Marks:2+2+4 Time:
15 min
7. Let R = (a, b, c, d, e, f) be a relation schema with the following dependences : c → f,
e → a, ec → d, a → b. Find a suitable primary key for R?
Marks: 3 Time: 7 min
8. Consider the relation schema R (A, B, C, D, E, H) with the following functional depen-
dencies: A → B, BC → D, E → C, D → A. What are the candidate keys of R?
Marks: 3 Time: 6 min
9. A relation NADDR is defined as follows.
NADDR = (name, street, city, state, postal_code)
where name is unique, and for any given postal code, there is just one city and
state
a. Give a set of FDs for this relation.
b. What are the candidate keys?
c. Is NADDR in3NF? 2NF? Explain why?
d. If NADDR is not in 3NF, normalize it into 3NF relations. Marks: 3+3+3
Time: 15 min
10. Suppose you are given a relation R with four atomic attributes ABCD. For the set of
functional dependencies F: {AB → C, AB → D, C → A, D → B} that hold on R, do
the following:
(a) Identify the candidate key(s) for R. Show your derivation.
(b) Identify the highest normal form that R satisfies (1NF, 2NF, 3NF, or BCNF).
Explain.
(c) If R is not in BCNF, decompose it into a set of BCNF relations that preserve the
dependencies.
Marks: 3+5+ 3 Time: 20 min
11. Let R ( A B C D E ) be a relation schema and consider the following functional depen-
dencies
F = { AB → E, AD → B,B → C, C→ D }, find out the candidate key.
13. Prove that, if any relation R has only one key, it is in BCNF if and only if it is in 3NF.
Marks: 3 Time: 6 min
14. Define a foreign key. Why is the concept needed? How does it play a role in the join
operation?
Marks:1+2+2 Time: 10
min
Module-VI: Internals of RDBMS
1. Consider the following SOL query for a bank database:
select T.branch_name
from branch T, branch S
where T.assets > S.assets and S.branch_city = “Brooklyn”.
Write an efficient relational-algebra expression that is equivalent to this query. Justify
you answer.
Question Bank_EC705C
Page 30
ACADEMY OF TECHNOLOGY
Question bank
Database management system(Ec705c)
10. Show that the two-phase locking protocol ensures conflict serializability and that
transactions can be serialized according to their lock points.
11. When a transaction is rolled back under timestamp ordering, it is assigned a new
timestamp. Why can it not simply keep its old timestamp?
6. A B+ tree index is to be built on the Name attribute of the relation STUDENT. Assume
that all student names are of length 8 bytes, disk blocks are of size 512 bytes, and
index pointer are of 4 bytes. What would be the best choice of the degree of the B+
tree?
7. The order of a leaf node in a B+ tree is the maximum number of (value, pointer) pairs
it can hold. Given that the block size is 1K bytes, data record pointer is 7 bytes long,
the value field is 9 bytes long and a block pointer is 6 bytes long, what is the order of
the leaf node?
8. A B- tree of order 4 is built from scratch by 10 successive iterations. What is the
maximum number of node splitting operations that may take place?
Question Bank_EC705C
Page 32