DBMS 2 Marks
DBMS 2 Marks
UNIT I – RELATIONAL
DATABASE PART - A
(2 MARKS)
The main purpose of going for database approach is to overcome problems faced in traditional
file- processing approach. The important characteristics of the database approach are the
following:
1. Self-Describing Nature of a Database System
2. Insulation between Programs and Data, and Data Abstraction
3. Support of Multiple Views of the Data
4. Sharing of Data and Multiuser Transaction Processing
Dr Edgar F. Codd, after his extensive research on the Relational Model of database systems came
up with twelve rules of his own, which according to him, a database must obey in order to be regarded as a
true relational database.
These rules can be applied on any database system that manages stored data using only its
relational capabilities. This is a foundation rule, which acts as a base for all the other rules.
2
CS8492-DBMS TWO MARKS
Instance: Collection of data stored in the data base at a particular moment is called an
Instance of the database.
Schema: The overall design of the data base is called the data base schema.
3
CS8492-DBMS TWO MARKS
4
CS8492-DBMS TWO MARKS
Key attribute: An entity type usually has an attribute whose values are distinct from each
individual entity in the collection. Such an attribute is called a key attribute.
Value set: Each simple attribute of an entity type is associated with a value set that specifies the set
of values that may be assigned to that attribute for each individual entity.
DDL: Data base schema is specified by a set of definitions expressed by a special language
called a data definition language.
DML:
A data manipulation language is a language that enables users to access or manipulate data
as organized by the appropriate data model.
26. Define tuple and attribute.
Attributes: column headers
Tuple : Row
Physical level. The lowest level of abstraction describeshowthe data are actually stored.
Logical level. The next-higher level of abstraction describes what data are stored in the
database, and what relationships exist among those data.
View level. The highest level of abstraction describes only part of the entire database. The
system may provide many views for the same database.
Functional dependency is a relationship that exists when one attribute uniquely determines
another attribute.
Here X is termed as a determinant set and Y as a dependant attribute. Each value of X is associated
precisely with one Y value.
7
CS8492-DBMS TWO MARKS
PART – B (QUESTIONS)
4. Explain the basic architecture of a database management system with neat block diagram.
5. Explain select, projection, Cartesian product and join operations in relational algebra with an
example.
9. Consider the relation student (reg.no., name, mark and grade). Write embedded dynamic
SQL program in C language to retrieve all the students records whose mark is more than 90.
8
CS8492-DBMS TWO MARKS
PART - A (2 MARKS)
9
CS8492-DBMS TWO MARKS
a) One to one
b) One to many
c) Many to one
d) Many to many
10
CS8492-DBMS TWO MARKS
11
CS8492-DBMS TWO MARKS
4. Construct an ER diagram for a car-insurance company whose customers own one or more cars
each. Each car has associated with its zero to any number of record accidents. State any
assumptions you make.
5. What is normalization? Explain normalization techniques using functional dependencies
with relevant examples.
6. Compare and contrast 3NF and BCNF.
7. Explain the multi-valued dependency and fourth normal form with example.
8. Explain the Join dependency and fifth normal form with example.
9. Draw an ER diagram for Hospital management system.
10. What is Functional Dependency? Explain types and properties of FD‟s.
11. Construct an ER diagram for university registrar‟s office. The office maintains data about each
class, including the instructor, the enrollment and the time and place of the class meetings. For each
student class pair a grade is recorded. Determine the entities and relationships.
12. Define generalization and aggregation. Demonstrate generalization and aggregation using E-R
diagram.
12
CS8492-DBMS TWO MARKS
UNIT 3
1. What are the ACID properties?
(Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee database transactions are
processed reliably. In the context of databases, a single logical operation on the data is called a transaction.
For example, a transfer of funds from one bank account to another, even though that might involve
multiple changes (such as debiting one account and crediting another), is a singletransaction.
2. What is transaction?
Collections of operations that form a single logical unit of work are called transactions.
3. What are the two statements regarding transaction?
The two statements regarding transaction of the form:
Begin transaction
End transaction
4. What is recovery management component?
Ensuring durability is the responsibility of a software component of the base system
called the recovery management component.
5. When is a transaction roll back?
Any changes that the aborted transaction made to the database must be undone. Once the changes
caused by an aborted transaction have been undone, then the transaction has been rolled back.
6. List out the statements associated with a database transaction.
Commit work
Rollback work
7. What are the two types of serializability?
A (possibly concurrent) schedule is serializable if it is equivalent to a serial schedule. Different forms
of schedule equivalence gives rise to the notions of:
1. Conflict serializability
2. View serializability
8. List the SQL statements used for transaction control.
Commit : Saves all transactions
Rollback : Used to undo transactions
Savepoint : Establishes a point back to which you may roll
Set Transaction : Establishes properties for current transaction.
9. What are the three types of intent Lock?
Intent Shared(IS)
Intent Exclusive (IX)
Shared Intent Exclusive(SIX)
20. What is the time stamp associated with each data item?
W-timestamp (Q) denotes the largest time stamp if any transaction that executed WRITE
(Q) successfully.
R-timestamp (Q) denotes the largest time stamp if any transaction that executed READ
(Q) successfully.
15
CS8492-DBMS TWO MARKS
PART – B ( QUESTIONS)
16
CS8492-DBMS TWO MARKS
14. Explain Two Phase- Locking protocol. What benefit does strict two-phase locking
protocol provides? Discuss its disadvantages.
15. How the use of 2PL would prevent interference between two transactions.
16. Why concurrency control is needed? Explain the problems that would arise when concurrency
control is not provided by the database system.
17
CS8492-DBMS TWO MARKS
PART - A (2 MARKS)
Mertis
Insertion in B+tree is easy.
Deletion in B+ tree is simple than B tree.
Demeris :
Requires redundant storage for search-key values every search key appears in some leaf node.
Several are repeated in non-leaf node.
Lookup on B+-tree requires traversal of a path from root of tree to some leaf node.
S.
Static hashing Dynamic hashing
No
1. Numbers of buckets are fixed Numbers of buckets are not fixed
2. As the file grows, performance de- As the file grows, performances do
creases. not
3. degrade.
Space overhead is more
4. Space overhead is less
Do not use bucket address table
5.
Open hashing and closed hashing are Bucket address table is
6. forms of it. used
Implementation is simple Extendable hashing and linear
7.
It is less attractive techniques hashing are forms of it.
8.
Overflow chaining is used Implementation is complex
It is more attractive techniques
Overflow chaining is not used
18
CS8492-DBMS TWO MARKS
2. Dense indices are faster than sparse Sparse indices are slower than dense
An index on a set of fields that includes An index that is not a primary key
1. the unique primary key for the field
a
leaf or a node with two or more children.A B+ tree can be viewed as a B-tree in which each node contains
only keys (not key-value pairs), and to at the bottom with linked leaves.
S.
B+ tree B- tree
No
1. B+ tree leaf node data are ordered B tree the leaf node cannot store
in a sequential linked list. using linked list.
2. B +tree store redundant search key B tree store non-redundant search
key
3. B+-tree data store only leaf nodes. B tree search keys and data stored in
internal or leaf nodes
4. Insertion of a B+ tree is not Insertion of a B tree is more compli-
compli- cated cated
20
CS8492-DBMS TWO MARKS
PART – B ( QUESTIONS)
1. What are the various ways of organizing records in files and explain any one file organization in detail.
2. Explain how the RAID system improves performance and reliability.
3. Describe the structure of B+ tree and list the characteristics of B+ tree.
4. What is RAID? Briefly explain different level of RAID.
5. Construct B+ tree to insert the following (order of tree is 3) 26, 27, 28, 3, 4, 7, 9, 46, 48, 51, 2, 6.
6. Describe briefly about indexing and hashing.
7. With neat diagram, describe about magnetic disks.
8. Give brief notes on overviews of physical storage media.
9. Explain in detail about internal hashing Techniques.
10. Discuss in detail about cluster and multilevel indexes.
11. By considering an example, show how to reduce access time with primary index.
12. When does a collision occur in hashing? Illustrate various collision resolution techniques.
13. Illustrate with an example for insertion and deletion operations on a B- Tree.
21
CS8492-DBMS TWO MARKS
PART - A (2 MARKS)
1. What are the two approaches to store a relation in the distributed database?
Replication: System maintains several identical replicas (copies) of the relation and stores each replica at a
differentsite.
Fragmentation: System Partitions the relation into several fragments and stores each fragment at a
different site.
2. Define Distribute Database.
The computers in a distributed system communicate with one another through various com- munication
media, such as high-speed networks or telephone lines. They do not share main memory or disk. The
computers in distributed system are referred by names such as sites or nodes.
3. What are the types of Transactions?
Distributed database system supports two types of transactions.
Local transaction : It is one that accesses data only from site where that transac- tion
was initiated.
Global transaction : It is one that either accesses data from a site other than the site where
that transaction was initiated or accesses data from several different sites.
4. Difference between homogeneous and heterogeneous database.
S.
Homogeneous Database Heterogeneous Database
No
Different nodes may have same Database application used at each location must
1.
hardware & software be same or compatible.
Database application used at each Database application used at each location must
3.
location must be same or compatible. be incompatible.
23
CS8492-DBMS TWO MARKS
Object consists of entity and attributes which can describe the state of real world object and action associated
with that object.
13. List out the Characteristics of Object.
Some important characteristics of an objectare:
Object name
Object identifier
Structure of object
Transient object
Persistent objects
25
CS8492-DBMS TWO MARKS
XML Database is used to store huge amount of information in the XML format. As the use of XML is
increasing in every field, it is required to have a secured place to store the XML docu- ments. The data
stored in the database can be queried using XQuery, serialized, and exported into a desiredformat.
22. What are the types of XML databases?
There are two types of XML databases.
1. XML-enabled database
2. Native XML database(NXD)
23. What are the attributes of XML?
XML elements can have attributes. By the use of attributes, we can add the in- formation
about the element.
XML attributes enhance the properties of the elements.
24. Difference between HTML and XML.
No. HTML XML
1) HTML is used to display data and fo- XML is a software and hardware
cuses on how data looks. indepen- dent tool used to transport and
store data. It focuses on what datais.
2) HTML is a markup language itself. XML provides a framework to define
markup languages.
3) HTML is not case sensitive. XML is case sensitive.
4) HTML is a presentation language. XML is neither a presentation language
nor a programming language.
5) HTML has its own predefined tags. You can define tags according to your
need.
6) In HTML, it is not necessary to use a XMLmakes it mandatory to use a
closing tag. closing tag.
7) HTML is static because it is used to XML is dynamic because it is used to
display data. transport data.
8) HTML does not preserve whitespaces. XML preserve whitespaces.
26
CS8492-DBMS TWO MARKS
2. Complex Type
Simple Type
The simple Type allows you to have text-based elements. It contains less attributes, child ele- ments, and
cannot be left empty.
Complex Type
The complex Type allows you to hold multiple attributes and elements. It can contain additional sub
elements and can be left empty.
28. Difference between DTD and XSD.
No. DTD XSD
DTD stands for Document Type XSD stands for XML Schema Defi-
1)
Definition. nition.
DTD provides less control on XML XSD provides more control on XML
8)
structure. structure.
XQuery is a functional language. It is used to retrieve and query XML based data.
XQuery is expression-oriented programming language with a simple type sys- tem.
XQuery is analogous to SQL. For example: As SQL is query language for data- bases, same
as XQuery is query language for XML.
XQuery is XPath based and uses XPath expressions to navigate through XML documents.
XQuery is a W3C standard and universally supported by all major databases.
27
CS8492-DBMS TWO MARKS
28
CS8492-DBMS TWO MARKS
PART – B (QUESTIONS)
29
CS8492-DBMS TWO MARKS
30