2 Marks Studoc
2 Marks Studoc
STUCOR
17 - The collection of information stored in the database at a particular moment called an instance of the
database.
- The overall design of the database is called the database schema
List the aggregation functions in SQL
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:
APP
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
(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
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.
2 Discuss about the different types of model in DBMS.
3 With relevant example to discuss about the various operations of Relation Algebra.
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.
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
objects. An entity is a thing or object in the real world that is distinguishable from other objects.
2 What is an entity and entity set?
An entity is an object that exists and is distinguishable from other objects. Example: specific person,
company, event, plant
Entity set: The set of all entities of the same type is termed as an entity set.
3 Define single valued and multivalued attributes.
APP
Single valued attributes : Attributes with a single value for a particular entity
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:
One to one
One to many
Many to one
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.
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?
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
STUCOR
™X → Y is a trivial functional dependency (Y ⊆ X)
→ Y, at least one of the following conditions hold
APP
A table is said to be in the 5NF if and only if every non-trivial join dependency in it is implied by the
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.
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.
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.
2 Draw an ER diagram for Banking System and Payroll system.
4 What is normalization? Explain the different types of normal forms with an example.
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
changes (such as debiting one account and crediting another), is a single transaction.
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:
APP
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 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.
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).
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
values ("view" the same data values)
8 What are two pitfalls (problem) of lock-based protocols?
Shared Lock : If a Transaction Ti has obtained a shared mode lock on data item Q, then Ti can read, but
cannot write Q.
Exclusive Lock : If the transaction Ti has obtained a shared mode Lock on item Q, then Ti can read and
also write Q.
9 What is meant by deadlock?
A system is in a deadlock state if there exists a set of transaction such that every transaction in the set is
waiting for another transaction in the set.
10 Define the phases of two phase locking protocol
Growing phase: a transaction may obtain locks but not release any lock.
Shrinking phase: a transaction may release locks but may not obtain any new locks.
11 What is Time-stamp based protocol?
Timestamp based protocol ensures Serializability. It selects an ordering among transactions in advance
using time stamps.
With each Transaction in the system, a unique fixed timestamp is associated. It is denoted by TS(Ti). This
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.
STUCOR
APP
15 Difference between deadlock prevention and deadlock avoidance.
Deadlock Prevention:
Preventing deadlocks by constraining how requests for resources can be made in the system and
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:
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.
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.
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
RAID level 2 –Memory style Error correcting code
RAID level 3 –Bit interleaved parity
RAID level 4 –Block interleaved parity
RAID level 5 – Block interleaved distributed parity
RAID level 6 – P+Q redundancy disk
2 List the merits and demerits of B+ tree index structure.
Mertis
APP
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.
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
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
7. It is less attractive techniques It is more attractive techniques
8. Overflow chaining is not used Overflow chaining is not used
maintenance for insertion and deletion maintenance for insertion and deletion
STUCOR
Space overhead
8 What is B+ tree?
A B+ tree is an n-ary tree with a variable but often large number of children per node. The root may be either 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 which an additional level is added at the bottom with linked leaves.
APP
9 Difference between B+ tree and B tree.
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
4. Insertion of a B+ tree is not complicated Insertion of a B tree is more complicated
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
There are 2 basic kinds of indices.
Ordered indices - Based on a stored ordering of the values
Hash indices - Based on a uniform distribution of values across a range of buckets.
17 List the advantages and disadvantages of B+ tree.
Advantage of B+-tree index files
Automatically reorganizes itself with small, local changes, in the face of insertions and deletions.
APP
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
the unique primary key for the field
2. Guaranteed not to contain duplicates May have duplicates
3. Also Called a Clustered index. Also Called a Non-Clustered index.
4. Eg: Employee ID Eg: Employee name
PART-B
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.
5 Describe briefly about indexing and hashing.
6 Explain about query processing in detail.
7 Discuss about query optimization in detail.
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
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 different site.
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 communication 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.
APP
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.
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.
STUCOR
10 What is ODMG?
The Object Database Management Group (ODMG) is made up of the leading Object Database
vendors plus a large number of companies that are interested in an ODBMS standard. The ODMG has
produced a standard for object databases. The ODMG Standard is an interoper- ability standard which
allows applications written to the standard to run on any com pliant system
11 List out the standard in ODMG.
APP
Object Model
Object Definition Language (ODL)
Object Query Language (OQL)
C++ Language Binding
Java Language Binding
12 What is XML Database?
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 desired
format.
13 Difference between HTML and XML.
Downloaded by Revathi J
DOWNLOADED FROM STUCOR
APP
STUCOR
runs on multiple machines.Creates a new copy of index instead of modifying old indexOld index is used to
answer queries .After a crawl is ―completed‖ new index becomes ―old‖ index
17 Define Simple attributes.
Attributes can be of primitive data type such as, integer, string, real etc. which can take literal value.
Example: 'ID' is simple attribute and value is 07.
18 List out the features of OODB.
APP
Complexity
Inheritance
Encapsulation
Persistency
19 What is XQuery?
XQuery is a standardized language for combining documents, databases, Web pages and almost anything else. It
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?
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.
2 Explain about Object Oriented Databases with suitable example.
3 Describe brief notes on ODMG.
4 Discuss in detail about XML Database with relevant examples.
5 Explain the DTD with suitable example.
6 Describe briefly on Information Retrieval (IR) with suitable example.