Cse249-Database-Management-System - QB
Cse249-Database-Management-System - QB
ENGINEERING
QUESTION BANK
1
Q. No. Questions
What are the advantages of using a DBMS? What is the purpose of database management system ?
a. The advantages of using a DBMS are
a) Controlling redundancy
b) Restricting unauthorized access
2.
c) Providing multiple user interfaces
d) Enforcing integrity constraints.
e) Providing backup and recovery
2
List the features of a database.
• It is a persistent (stored) collection of related data.
4. • The data is input (stored) only once.
• The data is organized (in some fashion).
• The data is accessible and can be queried (effectively and efficiently).
Define a database
5. Specifying the data types, structures, and constraints of the datato be stored using
a Data Definition Language
Define a data model.
A data model is a collection of concepts that can be used to describe the
6.
structure of a database. The model provides the necessary means to achievethe abstraction.
3
concentrates on describing entities, data types, relationships, user operations and constraints. Usually a
representational data model is used to describe the
conceptual schema.
What is an external or view level schema.
The External or View level –includes external schemas or user vies. Each external schema describes the
part of the database that a particular user group is interested in and hides the rest of the database from that
14. user group. Represented using the representational data model.
20.
CustomerID CustomerName
1 Google
2 Amazon
3 Apple
Define referential integrity constraints.
Referential integrity constraints is base on the concept of Foreign Keys. A foreign key is an important
attribute of a relation which should be referred to in other relationships. Referential integrity constraint state
happens where relation refers to a key attribute of a different or same relation. However, that key element
must exist in the table.
Example:
21.
5
• Insert is used to insert data into the relation
• Delete is used to delete tuples from the table.
• Modify allows you to change the values of some attributes in existing tuples.
• Select allows you to choose a specific range of data.
• Structural Independence: The relational database is only concerned with data and not with a
structure. This can improve the performance of the model.
• Easy to use: The relational model is easy as tables consisting of rows and columns is quite
natural and simple to understand
23. • Query capability: It makes possible for a high-level query language like SQL to avoid complex
database navigation.
• Data independence: The structure of a database can be changed without having to change any
application.
• Scalable: Regarding a number of records, or rows, and the number of fields, a database should be
enlarged to enhance its usability.
6
Define project operator in relational algebra.
Produces table containing subset of columns of argument table
• Example:
28.
• R S is expensive to compute:
7
What is a table in relational database.
A table is set of data elements that has a horizontal dimension (rows) and a vertical
dimension (columns) in a relational database system. A table has a specified number
30. of columns but can have any number of rows. Rows stored in a table are structurally
equivalent to records from flat files. Columns are
often referred as attributes or fields.
Define an identifier.
An identifier is an attribute that is used either as a primary key or as a foreign key.
31. The integer datatype is used for identifiers. In cases where the number of records
exceed the allowed values by the integer datatype then a big integer datatype is used.
What is a Query
37. A query is a request to retrieve data from a database with the SQL SELECT
instruction or to manipulate data stored in tables.
8
Define SQL
Structured Query Language (SQL), pronounced "sequel", is a language that
provides an interface to relational database systems. It was developed by IBM in the
38. 1970s for use in System
R. SQL is a de facto standard, as well as an ISO and ANSI standard.
What is Data independence & what are the levels. APRIL MAY 2008, MAY
/JUNE 2012, Nov 2017
The ability to modify a schema definition in one level without affecting aschema definition in the
next higher level called data independence.
41.
Different levels .
What are the various data base languages in SQL? April/May 2018
45. Data Definition Language (DDL)
Commands that define a database, including creating, altering, and dropping
9
tables and establishing constraints
Data Manipulation Language (DML)
Commands that maintain and query a database
Data Control Language (DCL)
Commands that control a database, including administering privileges and committing data
46.
10
among the attributes of an entity as well as the relationship among different entities.
- A relation may be visualized as a named table. Each column of the table
corresponds to an attribute of the relation and is named.
12
clauses of the outer SELECT statement (nested query).
• A subquery can be used immediately following a relational operator.
• Subquery always enclosed in parentheses.
Type of subquery:
▪ A scalar subquery returns a single column and a single row(singlevalue).
▪ A row subquery returns multiple columns, but a single row.
▪ A table subquery returns one or more columns and multiple rows.
Example:
List the staff who work in the branch at ‗163 Main St‘.
60. ▪ The SET clause specifies the names of one or morecolumns that are
columns.
What is DCL?
The Data Control Language (DCL) component of the SQL language is used to create privileges to
allow users access to, and manipulation of, the database.
61. There are two main commands:
GRANT to grant a privilege to a user
REVOKE to revoke (remove) a privilege from a user
13
Define GRANT command in SQL.
The Syntax for the GRANT command is:
GRANT privilege_name ON object_name TO {user_name |PUBLIC
|role_name} [WITH GRANT OPTION];
Description:
privilege_name is the access right or privilege granted to the user. Some of the access rights are ALL,
EXECUTE, and SELECT.
object_name is the name of an database object like TABLE, VIEW, STORED PROC and SEQUENCE.
user_name is the name of the user to whom an access right is being granted.
PUBLIC is used to grant access rights to all users.
62. ROLES are a set of privileges grouped together.
WITH GRANT OPTION - allows a user to grant access rights to other users.
14
The above rules also apply for ALTER and DROP system privileges.
What is object privileges?
Object privileges - This allows the user to EXECUTE, SELECT, INSERT, UPDATE, or DELETE data
from database objects to which the privileges apply.
66.
68.
15
It's easier to GRANT or REVOKE privileges to the users through a role rather than assigning a privilege
directly to every user. If a role is identified by a password, then, when you GRANT or REVOKE privileges
to the role, you
definitely have to identify it with the password.
What is the syntax for dropping a role in SQL?
The Syntax to drop a role from the database:
70. DROP ROLE role_name;
Example: To drop a role called developer, you can write:
DROP ROLE testing;
Define TCL.
TCL - Transactional Control Language. It is used to manage different transactions occurring within a
database.
Examples of TCL commands include:
71. COMMIT to apply the transaction by saving the database changes.
ROLLBACK to undo all changes of a transaction.
SAVEPOINT to divide the transaction into smaller sections. It defines
breakpoints for a transaction to allow partial rollbacks.
Define COMMIT in SQL.
SYNTAX:
COMMIT [WORK] [ COMMENT 'text' | FORCE 'text' [, integer] ]
Description:
WORK : is supported only for compliance with standard SQL. The statements COMMIT and
COMMIT WORK are equivalent.
COMMENT : specifies a comment to be associated with the current transaction. The 'text' is a quoted literal
of up to 50 characters that Oracle stores in the data dictionary view DBA_2PC_PENDING along with the
72. transaction ID if the transaction becomes in-doubt.
FORCE : manually commits an in-doubt distributed transaction. The transaction is identified by the 'text'
containing its local or global transaction ID. To find the IDs of such transactions, query the data dictionary
view DBA_2PC_PENDING. You can also use the integer to specifically assign the transaction a system
change number (SCN). If you omit the integer, the transaction is committed using the
current SCN. COMMIT statements using the FORCE clause are not supported in PL/SQL.
TO : rolls back the current transaction to the specified savepoint. If you omit this clause, the
ROLLBACK statement rolls back the entire transaction.
16
transaction is identified by the 'text' containing its local or global transaction ID. To find the IDs of such
transactions, query the data dictionary view DBA_2PC_PENDING. ROLLBACK statements with the
FORCE clause are not supported in PL/SQ
Static SQL statements in a source program must be processed before the program is compiled. This
processing can be accomplished through the DB2 precompiler or the SQL statement coprocessor.
75. The DB2 precompiler or the coprocessor checks the syntax of the SQL statements, turns them into host
language comments, and generates host language statements to invoke DB2.
The preparation of an SQL application program includes precompilation, the preparation of its static
SQL statements, and compilation of the modified source program.
17
List and describe the features and purpose of database?
1.
List and explain the limitations of file processing system?
2.
Compare database vs file processing system?
3.
What is data model? Explain various data models with example?
4.
Explain the database system architecture with neat diagram? April/May 2017,
5. Nov/Dec 2017
List and describe the components of database management system with neat
6. diagram.
Define relational algebra. Explain various relational algebraic operations with
7. example. Nov/Dec 2016, April/May 2017
List and explain the properties of a relations with example.
8
What are the various data types in SQL? Explain them with example?
9.
List and explain various database languages with example?
10
Explain DML with example?
11
18
What is an entity relationship model? May/ June 2016
The entity relationship model is a collection of basic objects called entitiesand relationship
1.
among those objects. An entity is a thing or object in the
real world that is distinguishable from other objects.
Define weak and strong entity sets? April/May 2009, April/May 2018 Weak entity set: entity
set that do not have key attribute of their own arecalled weak entity sets.
2. Strong entity set: Entity set that has a primary key is termed a strong entityset.
Give the limitations of ER model? How do you overcome this? May/June 2007
The entity relationship model is a collection of basic objects called entitiesand relationship
3. among those objects. An entity is a thing or object in the
real world that is distinguishable from other objects.
Give the distinction between primary key, candidate key and super key. Nov/Dec
2006,2009
Primary key – is used in a data base to avoid duplication of attributes andalso makes a relation
to the other database.
6. Candidate key - a key which is in the data base is called as candidate key, itmight be any key
attribute.
Super key – collection of keys of a database is called as super key
19
Define functional dependency. Nov/Dec2010, Apr/ May 2015
A functional dependency is a constraint between two sets of attributes fromthe data base. A
functional dependency , denoted by
X Y
Between two sets of attributes X and Y that are subsets of R specifies aconstraint on the
7.
possible tuples that can form a relation instance r of R.
R={ A1,A2,…,An}. The constraint states that ,for any two tuples t1 and t2
in r such that t1[X]=t2[X] , we must also have t1[Y] = t2[Y].
We can also say that Y is functionally dependent on X.
Define an entity?
Entities:
Entity -a thing (animate or inanimate) of independent physical orconceptual existence and
8. distinguishable.
Example:
In the University database context, an individual student, facultymember, a class room, a
course are entities.
What is an entity set?
Entity Set or Entity Type-Collection of entities all having the sameproperties.
Example:
9.
Student entity set –collection of all student entities.Course entity set –
collection of all course entities.
What is an attribute?
Attributes:
Attributes - Each entity is described by a set of
attributes/properties.studententity
10. Example:
StudName–name of the student. RollNumber–the roll number of
the student.Sex–the gender of the student etc.
All entities in an Entity set/type have the same set of attributes.
20
What is a recursive relationship?
Recursive relationships A recursive relationship is an entity is associatedwith itself.
Example:
An employee may manage many employees and each employee is managedby one employee.
12.
Define cardinality?
13. Cardinality
A business rule indicating the number of times a particular object or
21
activity may occur.
22
What is normalization?
Database normalization is the process of removing redundant data from the tables in to improve
storage efficiency, data integrity, and scalability.
In the relational model, methods exist for quantifying how efficient a database is. These
20. classifications are called normal forms (or NF), and there are algorithms for converting a given
database between them.
Normalization generally involves splitting existing tables into multiple ones, which must be re-
joined or linked each time a query is issued.
Define 1NF.
Each table has a primary key: minimal set of attributes which can uniquelyidentify a record
The values in each column of a table are atomic (No multi-value attributes
22.
allowed). There are no repeating groups: two columns do not store similarinformation in the
same table
Define 2NF.
where a key has more than one attribute, check that each non-key attribute depends on the whole
key and not part of the key
for each subset of the key which determines an attribute or group of attributes create a new form.
23.
Move the dependant attributes to the newform.
Add the part key to new form, making it the primary key.Mark the part key as
a foreign key in the original form.
Define 3NF.
A relation R is in Third Normal Form (3NF) if and only if it is:in Second Normal
24.
Form.
Every non-key attribute is non-transitively dependent on the primary key.
23
Define BCNF
Boyce-Codd Normal Form:
• A relation is in Boyce-Codd normal form (BCNF) if for every FD A Beither
o B is contained in A (the FD is trivial), or A contains a
candidate key of the relation,
25.
• In other words: every determinant in a non-trivial dependency is a(super) key.
The same as 3NF except in 3NF we only worry about non-key Bs
If there is only one candidate key then 3NF and BCNF are the same
Define MVD.
A multivalued dependency is a full constraint between two sets of attributes in a relation.
In contrast to the functional independency, the multivalued dependencyrequires that certain tuples
27. be present in a relation. Therefore, a multivalued dependency is also referred as a tuple-
generating dependency. The
multivalued dependency also plays a role in 4NF normalization.
Define 4NF.
4th Normal Form
A Boyce Codd normal form relation is in fourth normal form ifthere is no multi value
dependency in the relation or
there are multi value dependency but the attributes, which are multi valuedependent on a
specific attribute, are dependent between themselves.
28.
sume the following relation
a:pk1, b:pk2, c:pk3)
Recall that a relation is in BCNF if all its determinant are candidate keys, inother words each
determinant can be used as a primary key.
Because relation R has only one determinant (a, b, c), which is thecomposite primary key and
since the primary is a candidate key therefore R
is in BCNF.
Define 5NF
FIFTH NORMAL FORM
29. R is in 5NF if and only if every join dependency in R is implied by thecandidate keys of R
5NF is always achievable.
24
a join dependency, * (A, B, …, Z), is implied by the candidate keys, K1, …,
Km of R
the fact that K1, …, Km are candidate keys for R determine the fact that
R has the JD * (A, B, …, Z)
Show the binary relationship in diagram?
30.
25
What is a domain in a database.
The term domain is used to refer to a set of values of the same kind or type. For example, the
column, "Cname‟ and "Ccity‟ in the following figure, both have values of type string (ie. valid
values are any string). But they denote different domains, ie."Cname‟ denotes the domain of
customer names while "Ccity‟ denotes the domain of city names. They are different domains even
if they share common values.
34.
26
Distinguish between key and super key? April/May 2017
40.
Define lossless joins (or) What is non additive property. Nov/Dec 2011
Lossless join property or non additive property ensures that nospurious tuples(tuples
45. containing wrong information) are generated when a natural join
operation is applied to the relations in the decomposition.
Explain BCNF with example(or) How to convert a relation into BCNF. Nov/dec 2007, 2008,
2009 2010, 2011,2014
Boyce-Codd Normal form: It is stricter than 3NF, meaning that every relation in BCNF is also in
46. 3NF; however a relation in 3NF is not necessarily in BCNF. A relation is in BCNF if and only if
every determinant
is a candidate key (i.e) a relatioln schema R is in BCNF if whenever a functional dependency X-
>A holds in R, then X is a superkey of R
What are pitfalls in relational database design?Nov/Dec2009 2010
47.
o Repetition of informaition
27
o Inability to represent certain information
o Loss of information
State the anomalies of 1NF. Nov/ Dec 2015.
48. No repeating groupsRedundancy of data
Why 4NF in Normal Form is more desirable than BCNF? (Nov/Dec 2014, Dec 2017)
BCNF (Boyece code normal form) has all functional dependencies A to B are trivial of
discriminator should be superkey. To get relation in BCNF, Splitting the relation schema not
necessarily preserve all functional dependency, Loss less decomposition and dependency are main
points for the normalization sometime, it is not possible to get a BCNF decomposition that is
dependency, preserving. While 4NF has very similar definition as BCNF. A relational Schema is
54. in 4NF, if all multivalued dependencies A to B are trivial and determinate A is superkey of schema.
If a relational schema is in 4nf, it is already in BCNF. and 4NF decomposition preserve the all
functional dependency. so 4NF is preferable than to have BCNF.
28
Explain The Different Types Of Normalization Nov/Dec 2009, 2010, 2011, Nov/ Dec 2014,
1 Apr/May 2015, Nov/Dec 2016
Refer the Elmasri Navathe page no. 517
Explain In Detail About Boyce Codd Normal Form And Non LosslessJoin Dependency.
2 Nov/Dec 2009, 2010, 2011
Refer the Elmasri Navathe page no. 529
Give Detail explanation about Data Model & its types. May/ June 2009,Nov/ Dec 2014
Refer the Elmasri Navathe page no. 30
3
Discuss the correspondence between the ER model construct and the relational model
constructs. Show how each ER model construct can be mapped to the relational model.
6
Discuss the option for mapping EER
model construct. April/May 2017
Various join strategies with Example. Nov/Dec 2016Nested loop join
Block nested loop joinMerge join
7 Hash join
Give detail Explanation about Query processing / Optimization overview with example.
Nov/Dec 2014, May/ June 2016, Nov/Dec 2016, Nov/Dec 2017.
11
Elmasri Navathe page no.679
12
29
A car rental company maintains a database for all vehicles in its current fl vehicles, it includes
the vehicle identification number, license number, m date of purchase, and color. Special data
are included for certain types of
• Trucks: cargo capacity.
• Sports cars: horsepower, renter age requirement.
• Vans: number of passengers.
• Off-road vehicles: ground clearance, drivetrain (four- or two-wheel driv Construct an ER
model for the car rental company database. (Nov/Dec 15
Construct an E-R diagram for a car insurance company whose customers cars each. Each car
has associated with it zero to any number of recorded insurance policy covers one or more
13
cars, and has one or more premium associated with it. Each payment is for a particular
period of time set of c
date when the payment was received. (Nov/Dec 16)
14
Draw E – R Diagram for the “Restaurant Menu Ordering System”, whic food items ordering
and services within a restaurant. The entire restaura detailed as follows. The Customer is
able to view the food items menu, c orders and obtain the final bill through the computer
kept in their table. their wireless tablet PC are able to initialize a table for customers, contro
to assist customers, orders, send orders to food preparation staff (chef) a customer’s bill. The
15 food preparation staffs (Chefs), with their touch-dis system, are able to view orders sent to
the kitchen by waiters. During pr able to let the waiter know the status of each item, and can
send notificat completed. The system should have full accountability and logging facili
support supervisor actions to account for exceptional circumstances, suc
refunded or walked out on. (Apr/May 17)
30
Q. No. Questions
What is transaction?Nov/Dec 2010 Nov/Dec 2014
1 Collections of operations that form a single logical unit of work are
called transactions.
What are the properties of transaction? Nov /Dec 2009, April/May2010 NOV/DEC 2014 ,
May/June 2016 (or) What are the ACID properties? APRIL/MAY-2011 , Nov/Dec 2017,
The properties of transactions are:Atomicity
ConsistencyIsolation
2
Durability
31
An alternative to log-based crash recovery technique is shadow paging. This
technique needs fewer disk accesses than do the log-based methods.
When is a transaction rolled back?
Any changes that the aborted transaction made to the database must beundone.
9 Once the changes caused by an aborted transaction have been undone, thenthe transaction has
been rolled back.
32
Define upgrade and downgrade?
It provides a mechanism for conversion from shared lock to exclusive lockis known as upgrade.
19
It provides a mechanism for conversion from
exclusive lock to shared lock is known as downgrade.
What is a database graph?
20 The partial ordering implies that the set D may now be viewed as a directedacyclic graph, called
a database graph.
What are the two methods for dealing deadlock problem?
The two methods for dealing deadlock problem isdeadlock detection
21
deadlock recovery.
What are the time stamps associated with each data item?
W-timestamp (Q) denotes the largest time stamp if any transaction that
26
executed WRITE (Q) successfully. • R-timestamp (Q) denotes the largest time stamp if any
transaction that executed READ (Q) successfully.
Define blocks? What are its types?
The database system resides permanently on nonvolatile storage, and ispartitioned into
fixedlength storage units called blocks.
Physical blocks
27 The input and output operations are done in block units. The blocks residingon the disk are
referred to as physical blocks.
Buffer blocks
The blocks residing temporarily in main memory are referred to as buffer
blocks
What is meant by concurrency control? Nov/Dec 2015
28
Process of managing simultaneous operations on the database without
33
having them interfere with one another.
Prevents interference when two or more users are accessing databasesimultaneously and at least
one is updating data.
Give an example of Two phase commit protocol. Nov/Dec 2015
In distributed databases, "single phase" commit is what is used. All the necessary information for
the transaction to be undone or completed are written to persistent storage (typically called a
"transaction log") in an atomic step. The transaction is committed as soon as this information is
29 permanently recorded. This is not possible in a distributed system, as there's no guarantee that the
commit record is written on all participating systems. With distributed databases, Two Phase
Commit solves this problem.
State the difference between a shared lock and an exclusive lock.April/May 2018.
Shared lock:
Shared locks are placed on resources whenever a read operation (select) isperformed.
Multiple shared locks can be simultaneously set on a resource.
Exclusive lock:
33
Exclusive locks are placed on resources whenever a write operation(INSERT, UPDATE And
DELETE) are performed.
Only one exclusive lock can be placed on a resource at a time.
34
i.e. the first user who acquires an exclusive lock will continue to have the
sole ownership of the resource, and no other user can acquire an exclusivelock on that resource
Define Durability?
37 A transaction completes successfully then changes It has made to the
database persist even if there are system failure.
What is transaction-management component?
Ensuring atomicity is the responsibility of the database system itselfspecifically, it
38
is handled by a component called the transaction-
management component.
What are the two operation for accessing data in transaction?
39 Read(x)- transfer data item x from database. Write(x)- transfer data
item x from the local buffer.
What do you mean by read only transaction?
40 The data base operation in a transaction do not update the database but onlyretrieve data, the
transaction is called a read-only transaction.
What are the steps followed in Executing read(x)command intransaction?
1. Find the address of the disk block that contains item x.
41 2. Copy that disk block in to a buffer in main memory.
3. Copy item x from the buffer to the program variable named x.
36
Refer the Elmasri Navathe page no 584
Explain about locking protocols. May/June 2016 Refer the Elmasri
6
Navathe page no 584
Discuss about conflict and view serializability. April/ May 2015. Nov/ Dec 2015
7 Refer the Elmasri Navathe page no 570
Explain Deadlock in detail with an example. . Nov/Dec 2014 , Nov/ Dec2015, Nov/Dec 2017
8 Refer the Elmasri Navathe page no 591
State and explain the lock based concurrency control with suitableexamples? Nov/Dec 2017
12
Discuss the violations caused by each of the following: dirty read, non-repeatable read and
13
phantoms with suitable example. April/May 2017.
Explain why timestamp-based concurrency control allows schedulesthat are not
14 recoverable. Describe how it can be modified through
buffering to disallow such schedules. April/May 2017.
How can you implement atomicity in transactions? Explain.
15
37
What is B-Tree?
1
A B-tree eliminates the redundant storage of search-key values.It allows search key values to appear
only once.
What is an index?
8
An index is a structure that helps to locate desired records of arelation quickly,
without examining all records
What are the factors to be taken into account when choosing aRAID level?
Monetary cost of extra disk storage requirements.
Performance requirements in terms of number of I/O operations Performance when a
9
disk has failed and Performances during
rebuild.
38
11 What is called remapping of bad sectors?
If the controller detects that a sector is damaged when the disk is initially formatted, or
when an attempt is made to write the sector, it can logically map the sector to a different
physical location.
What are the ways in which the variable-length records arise indatabase systems?
Storage of multiple record types in a file, Record types that allowvariable lengths for
14
one or more fields, Record types that allow
repeating fields.
15
Anchor block: Contains the first record of a chain.
Overflow block: Contains the records other than those that are thefirst record of a
chain.
39
Give an example of a join that is not a simple equi-join for whichpartitioned parallelism can be
19 used. (Nov/Dec 15)
40
query is a query evaluation plan or a query execution plan.
41
faster than scanning the entire data file for the indexed data.
Compare sequential access devices versus random access devices with an example
sequential access devices random access devices Must be accessed from the beginning It is possible to read
data from any location Eg:- tape storage Eg:-disk storage Access to data is much slower Access to data is
faster Cheaper than disk Expensive when compared with disk
33
Explain how reliability can be improved through redundancy?
The simplest approach to introducing redundancy is to duplicate every disk. This technique is called
mirroring or shadowing. A logical disk then consists of two physical disks, and write is carried out on both
the disk. If one of the disks fails the data can be read from the other. Data will be lost if the second disk
34
fails before the first fail ed disk is repaired.
What is database tuning? APRIL/MAY-2011
Database tuning describes a group of activities used to optimize and homogenize the performance of a
database. It usually overlaps with query tuning, but refers to design of the database files, selection of the
database management system (DBMS), operating system and CPU the DBMS runs on.
35
What are a block and a block number?
A block is a contiguous sequence of sectors from a single track of one platter. Each request specifies
36 the address on the disk to be referenced. That address is in the form of a block number.
42
– When writing data, corresponding parity bits must also be computed and written to a parity bit disk
– To recover data in a damaged disk, compute XOR of bits from other disks (including parity bit disk)
I/O operation addresses all the drives at the same time, RAID 3 cannot overlap I/O. For this reason,
RAID 3 is best for single-user systems with long record applications
44
Q. NO. QUESTIONS
3
Explain Secondary storage devices.
45
What is homogeneous distributed database and heterogeneousdistributed database
A homogeneous distributed database has identical software and hardware running all
databases instances, and may appear through a single interface as if it were a single
1 database. A heterogeneous distributed database may have different hardware, operating
systems,database management systems, and even data models for different
databases
46
Define Database replication.
Database replication can be used on many database management systems, usually with a
master/slave relationship between the original and the copies. The master logs the updates,
which then ripple through to the slaves. The slave outputs a message stating that it has
received the update successfully, thus allowing the sending of subsequent
updates.
How do you define types in object relational feature in oracle? Oracle allows us to
9 define types similar to the types of SQL. The syntax is
CREATE TYPE t AS OBJECT ( list of attributes and methods );
Define ODL.
ODL langauge is used to create object specifications: classes and interfaces
- Using the specific langauge bindings to specify how ODL constructs can be mapped to
11
constructs in specific programming
language, such as C++, SMALLTALK, and JAVA
47
Define Information Retrieval.
12
It is an activity of obtaining information resources relevant to an
information need from a collection of information resources
Can we have more than one constructor in a class? If yes, explain the need for such a
14
situation. (Nov/Dec 15)
Yes, default constructor and constructor with parameter
48
How does the concept of an object in the object-oriented modeldiffer from the
concept of an entity in the entity-relationship model?(Nov/Dec 16)
An entity is simply a collection of variables or data items. An object is an encapsulation of
data as well as the methods (code) to operate on the data. The data members of an object are
18
directly visible only to its methods. The outside world can gain access to the object’s data
only by passing pre-defined messages to it and these messages are
implemented by the methods.
Is XML Hierarchical?
XML documents have a hierarchical structure and can conceptually beinterpreted as a tree
19 structure, called an XML tree. XML documents must contain a root element (one that is the
parent of all other elements). All elements in an XML document can contain sub
elements, text and attributes.
What is DTD?
A document type definition (DTD) contains a set of rules that can be used to validate an
20 XML file. After you have created a DTD, you can edit it manually, adding declarations that
define elements, attributes, entities, and notations, and how they can be used for any XML
files
that reference the DTD file.
49
Wildcard Queries
Natural Language Queries
S.No Information Retrieval DBMS 1 Imprecise semantics Precise semantics 2 Keyword search SQL 3
Unstructured data format Structured data 4 Reads mostly. Adds document occasionally. Expects reasonable
26
number of updates. 5 Displays page through top k results. Generates full answer.
50
Multi - DBMS Architecture
51
result in only the reading of the relation, then several sites can process queries involving r in parallel. The
more replicas of r there are, the greater the chance that the needed data will be found in the site where the
transaction is executing. Hence, data replication minimizes movement of data between sites. Increased
overhead on update. The system must ensure that all replicas of a relation r are consistent; otherwise,
erroneous computations may result. Thus, whenever is updated, the update must be propagated to all sites
containing replicas. The result is increased overhead. For example, in a banking system, where account
information is replicated in various sites, it is necessary to ensure that the balance in a particular
account agrees in all sites.
Define Transparency
The user of a distributed database system should not be required to know where the data are physically
35 located nor how the data can be accessed at the specific local
site. This characteristic, called data transparency, can take several forms:
What are the DISTRIBUTED TRANSACTIONS
There are two types of transaction that we need to consider.
Local transactions are those that access and update data in only one local database;
36 Global transactions are those that access and update data in several local databases
Write the System Failure Modes
Failure of a site. Loss of messages.
Failure of a communication link. Network partition
37
Define Complex Data Types .,
38 Traditional database applications have conceptually simple datatypes. The basic
data items are records that are fairly small and whose fields are atomic.
What is Structured Type?
Structured types allow composite attributes of E-R designs to be represented directly. For instance, we
39 can define the following structured type to represent a
composite attribute name with component attribute firstname and lastname:
Write the Object-Identity and Reference Types in SQL
Object-oriented languages provide the ability to refer to objects. An attribute of a type can be a reference to
an object of a specified type. For example, in SQL we can define a type Department with a field name and
a field head that is a reference to the type Person, and a table departments of type Department, as follows:
create type Department ( name varchar(20),
40 head ref(Person) scope people);
create table departments of Department;
Here, the reference is restricted to tuples of the table people.
52
systems can be translated to the simpler type system of relational databases. Sub tables can be stored
in an efficient manner
Define Objects and Literals .
Objects and literals are the basic building blocks of the object model. The main difference between the two
is that an object has both an object identifier and a state (or current value), whereas a literal has a value
42 (state) but no object identifier. In either case, the value can have a complex structure. The object state
can change over time by modifying the object value. A literal is basically a constant value, possibly having
a complex structure, but it does not change.
53
3
Write short notes on Distributed Transactions.
4
Explain in detail the Client - Server Architecture for DDBMS
Suppose an Object Oriented database had an object A, which references object B, which in
turn references object C. Assume all objects are on disk initially? Suppose a program first
5 dereferences A,then dereferences B by following the reference from A, and then finally
dereferences C. Show the objects that are represented in
memory after each dereference, along with their state.
Suppose that you have been hired as a consultant to choose a databasesystem for your
client’s application. For each of the following applications, state what type of database
system (relational, persistent programming language–based OODB, object relational; do not
specify a commercial product) you would recommend. Justify your recommendation.
(i)A computer-aided design system for a manufacturer of airplanes.(ii)A system to track
6
contributions made to candidates for public office.
(iii)An information system to support the making of movies.
Give the DTD for an XML representation of the following nested-relational schema
Emp = (ename, ChildrenSet setof(Children), SkillsSet setof(Skills)) Children = (name,
Birthday)
7
Birthday = (day, month, year)
Skills = (type, ExamsSet setof(Exams)). Exams = (year, city)
(Nov/Dec 16)
8
Explain XML Schema with an example.
Explain various queries in IR Systems with an example.
9
54
10 Explain ODL and OQL with an example.
11
Explain ODMG – Object Model in detail
Explain XML Databases.
12
Exaplain the object relational database features.
13
Explain Information Retrieval process in detail
14
Give the DTD or XML Schema for an XML representation of the nested relational schema .
15
55