Database Management System CS3492 - REGULATION 2021 Downloaded From Stucor App
Database Management System CS3492 - REGULATION 2021 Downloaded From Stucor App
P
Aggregate functions are functions that take a collection of values as input and return a
single value as output.
SQL offers 5 built in aggregate funtions:
AP
18 avg - average value
min - minimum value
max - maximum value
sum - sum of values
count - number of values.
Define views.
19 A view is an object that gives the user a logical view of data from an underlying table or tables
R
(relation or relations). ™ It is not desirable for all users to see the entire logical model.
What is Embedded SQL?
An embedded SQL statement is distinguished from the host language statements by enclosing it
CO
20 between EXEC SQL or EXEC SQL BEGIN and a matching END-EXEC or EXEC SQL END (or
semicolon) ™ Syntax may vary with language ™ Shared variables (used in both languages) usually
prefixed with a colon (:) in SQL
PART-B
1 Explain the basic architecture of a database management systems.
Discuss about the different types of model in DBMS.
U
3 With relevant example to discuss about the various operations of Relation Algebra.
ST
Consider the employee database , where the primary keys are Underlined.
employee(empname,street,city),works(empname,companyname,salary)
7 company(companyname,city), manages(empname,management)
Give an expression in the relational algebra for each request.
P
Entity set: The set of all entities of the same type is termed as an entity set.
3 Define single valued and multivalued attributes.
Single valued attributes : Attributes with a single value for a particular entity
AP
Multivalued attributes : Attributes with a set of value for a particular entity
4 Define null values.
In some cases a particular entity may not have an applicable value for an attribute or if we do not know
the value of an attribute for a particular entity. In these cases null value is used
5 Define Mapping cardinalities.
Mapping cardinalities or cardinality ratios express the number of entities to which another entity can be
associated. Mapping cardinalities must be one of the following:
R
One to one
One to many
Many to one
CO
Many to many
6 Define the terms Generalization and Aggregation
Generalization is a containment relationship that exists between a high-level Entity set and one or more
low-level entity set.
Aggregation is an abstraction through which relationships are treated as higher-level entities
7 Compare weak and strong entity sets.
U
Weak entity set : entity set that do not have key attribute of their own are called weak entity sets.
Strong entity set : Entity set that has a primary key is termed a strong entity set
8 What is ER diagrams?
ST
An entity-relationship diagram is a data modeling technique that creates a graphical representation of the
entities, and the relationships between entities, within an information system.
9 What are the steps involved in creating ERD?
a) Identify the entities.
b) Find the relationships
c) Identify key attributes for every entity
d) Draw the ERD.
10 What is normalization?
Database normalization is the process of organizing the fields and tables of a relational database to
minimize redundancy and eliminate dependency. Normalization usually involves dividing large tables
into smaller (and less redundant) tables and defining relationships between them.
11 Define 1NF.
A relation said to be first normal form if and if only all attributes are atomic in nature
12 Define 2NF.
A relation said to be second normal form if and if only relation should be in first normal form and to
Define 3NF.
13 A relation said to be third normal form if and if only relation should be in second normal form and to
eliminate transitive dependency.
14 Define BCNF.
A relational schema R is in Boyce–Codd normal form if and only 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
15 What is 4NF and 5NF?
P
A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X Y, X is a
superkey that is, X is either a candidate key or a superset
A table is said to be in the 5NF if and only if every non-trivial join dependency in it is implied by the
AP
candidate keys.
16 Define De-normalization.
De-normalization is the process of attempting to optimize the read performance of a database by adding
redundant data or by grouping data.
17 What is sub-class and super class?
For example, members of entity Employee can be grouped further into Secretary, Engineer, Manager,
Technician, Salaried_Employee.
R
The set listed is a subset of the entities that belong to the Employee entity, which means that every entity
that belongs to one of the sub sets is also an Employee.
Each of these sub-groupings is called a subclass, and the Employee entity is called the super-class.
CO
18 List out the constraints on Specialization and Generalization.
Several specializations can be defined on an entity type. ™ Entities may belong to subclasses in each of
the specializations. ™ The specialization may also consist of a single subclass, such as the manager
specialization, in this case we don’t use the circle notation.
PART-B
1 Explain about Entity relationship model with ER diagram and example.
U
4 What is normalization? Explain the different types of normal forms with an example.
P
The two statements regarding transaction of the form:
AP
Begin transaction and End transaction
4 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:
Conflict serializability
View serializability
5
R
List the SQL statements used for transaction control.
Commit : Saves all transactions
Rollback : Used to undo transactions
CO
Savepoint : Establishes a point back to which you may roll
Set Transaction : Establishes properties for current transaction.
6 What is Conflict-Serializability?
Conflict-Serializability is defined by equivalence to a serial schedule (no overlapping transactions) with the
same transactions, such that both schedules have the same sets of respective chronologically ordered pairs of
conflicting operations (same precedence relations of respective conflicting operations).
U
7 What is View-Serializability?
View-Serializability of a schedule is defined by equivalence to a serial schedule (no overlapping transactions)
with the same transactions, such that respective transactions in the two schedules read and write the same data
ST
timestamp is assigned by the database system before the transaction Ti status execution. If a transaction Ti has
been assigned time- stamp TS(Ti) and new transaction Tj enters the system, then TS(Ti)<TS(Tj).
12 What is Concurrency Control?
Process of managing simultaneous execution of transactions in a shared database, to ensure the Serializability
of transactions, is known as concurrency control.
13 List out the statements associated with a database transaction? 6.
Commit work .
Rollback work
14 Draw the states of Transaction.
P
AP
R
15 Difference between deadlock prevention and deadlock avoidance.
CO
Deadlock Prevention:
how requests for resources can be made in the system and
Preventing deadlocks by constraining
how they are handled (system design).
The goal is to ensure that at least one of the necessary conditions for deadlock can never hold.
Deadlock Avoidance:
U
The system dynamically considers every request and decides whether it is safe to grant it at this point,
The system requires additional apriori information regarding the overall poten- tial use of each resource
for each process.
Allows more concurrency.
ST
PART-B
1 Explain about ACID properties with suitable example.
2 Describe briefly about Serializability and its types with relevant example.
Discuss the following transaction with relevant example:
I. Read Only Transaction
3
II. Read Write Transaction
III. Aborted Transaction
4 Discuss in detail about two phase commit protocol.
5 Explain the concepts of Concurrency control mechanism.
6 Describe briefly about deadlock handling.
Why concurrency control is needed? Explain the problems that would arise when concurrency
7
control is not provided by the database system.
P
2 List the merits and demerits of B+ tree index structure.
Mertis
AP
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.
3 Differentiate Static hashing and Dynamic hashing.
R
S. No Static hashing Dynamic hashing
1. Numbers of buckets are fixed Numbers of buckets are not fixed
As the file grows, performance de As the file grows, performances do Not
CO
2.
creases. degrade
3. Space overhead is more Space overhead is less
4. Do not use bucket address table Bucket address table is used
Open hashing and closed hashing are Extendable hashing and linear hashing
5.
forms of it. are forms of it.
6. Implementation is simple Implementation is complex
U
maintenance for insertion and deletion maintenance for insertion and deletion
P
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 which an additional level is added at the bottom with linked leaves.
9 Difference between B+ tree and B tree.
AP
S. No B+ tree B- tree
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
R
4. Insertion of a B+ tree is not complicated Insertion of a B tree is more complicated
CO
10 Define Seek time.
Seek time: Time it takes to reposition the arm over the correct track. The seek time ranges from 2 to 30
milliseconds. The average seek time is one-third the worst case seek time and one half the maximum seek time.
Average seek time currently ranges between 4 to 10 milliseconds.
11 Define File organization.
U
The database is stored as a collection of files. Each file is a sequence of records. A record is a sequence of fields.
We have a file with 2 types of records.
Fixed length records.
ST
P
17
Advantage of B+-tree index files
Automatically reorganizes itself with small, local changes, in the face of insertions and deletions.
AP
Reorganization of entire file is not required to maintain performance.
Disadvantage of B+-tree
Extra insertion and deletion overhead, space overhead.
18 Difference between Primary index and Secondary index.6.
S. No Primary index Secondary index
1. An index on a set of fields that includes An index that is not a primary key
R
the unique primary key for the field
2. Guaranteed not to contain duplicates May have duplicates
CO
3. Also Called a Clustered index. Also Called a Non-Clustered index.
4. Eg: Employee ID Eg: Employee name
PART-B
U
1 What are the various ways of organizing records in files and explain any one file organization in detail.
2 Describe the structure of B+ tree and list the characteristics of B+ tree.
3 What is RAID? Briefly explain different level of RAID.
4 Give brief notes on overviews of physical storage media.
ST
P
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?
AP
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.
R
S. No Homogeneous Database Heterogeneous Database
Different nodes may have same Database application used at each location must
1. hardware & software be same or compatible.
CO
Autonomy
Availability
Disadvantages :
Software development cost
Greater potential for bugs
Increased processing overhead
6 Define Transparency.
The user of a distributed database system should not be required to know either where the data are physically
located or how the data can be accessed at the specific local site. This characteristic called data transparency.
7 What is Object Oriented Database?
An object-oriented database is a database that subscribes to a model with information rep resented by
objects. Object-oriented databases are a niche offering in the relational database management system
(RDBMS) field and are not as successful or well-known as mainstream database engines.
8 What is Object?
Object consists of entity and attributes which can describe the state of real world object and action
associated with that object.
P
allows applications written to the standard to run on any com pliant system
11 List out the standard in ODMG.
Object Model
AP
Object Definition Language (ODL)
Object Query Language (OQL)
C++ Language Binding
Java Language Binding
12 What is XML Database?
R
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
CO
data stored in the database can be queried using XQuery, serialized, and exported into a desired
format.
13 Difference between HTML and XML.
cuses on how data looks. used to transport and store data. It focuses on what
data is.
2) HTML is a markup language itself. XML provides a framework to define markup
ST
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 XML makes 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 transport
display data. data.
8) HTML does not preserve whitespaces. XML preserve whitespaces.
14 Define DTD.
DTD stands for Document Type Definition. It defines the legal building blocks of an XML
document. It is used to define document structure with a list of legal elements and attributes.
P
Example: 'ID' is simple attribute and value is 07.
18 List out the features of OODB.
Complexity
AP
Inheritance
Encapsulation
Persistency
19 What is XQuery?
XQuery is a standardized language for combining documents, databases, Web pages and almost anything else. It
R
is very widely implemented. It is powerful and easy to learn. XQuery is replacing proprietary middleware
languages and Web Application development languages.
20 What is XML schema?
CO
XML schema is a language which is used for expressing constraint about XML documents. There are so many
schema languages which are used now a days for example Relax- NG and XSD (XML schema definition).An
XML schema is used to define the structure of an XML document. It is like DTD but provides more control on
XML structure.
PART-B
1 Discuss in detail about the various types of distributed database with suitable examples.
U