Professional Documents
Culture Documents
DBMS Sem
DBMS Sem
DBMS Sem
(UNIT-1)
1.Give an over view of following database languages: DML ,DDL ,DCL.
2.Distinguish strong entity set and week entity set. Draw E-R diagram
for week entity set.
UNIT-2
1. Compare Super key, Candidate key and Primary Key for a relation with
examples.
UNIT-4
1. What is transaction? Explain the ACID Properties of transactions.
2. Explain the time stamp Based protocols for concurrency control in DBMS.
3. Implementation of Lock —Based Protocols in DBMS.
4. Explain Log based recovery.
5. Explain the Need of Serial izability? Explain view and conflict Serializability.
6. How to test serializability of a schedule? Explain with an example
7. Explain ARIES algorithm.
8. Explain ACID properties of a transaction and illustrate how atomicity and durability are 5M
achieved.
9. . Explain 2PL and strict 2PL protocol in detail?
UNIT-5
1.What are the indexed data structures? Explain any one of them. Compare heap
file organization with hash file organization
2.Explain how insert and delete operations are handled in a static hash index. Give
a brief note on Indexed Sequential Access Methods.
5. Explain ISAM.
7. Write in detail about Hash based Indexing and Tree based Indexing.
UNIT-1
1ANS) Structured Query Language(SQL) as we all know is the database
language by the use of which we can perform certain operations on the existing
database and also we can use this language to create a database. SQL uses
certain commands like Create, Drop, Insert, etc. to carry out the required tasks.
DDL or Data Definition Language actually consists of the SQL commands that
can be used to define the database schema. It simply deals with descriptions of
the database schema and is used to create and modify the structure of database
objects in the database.DDL is a set of SQL commands used to create, modify,
and delete database structures but not data. These commands are normally not
used by a general user, who should be accessing the database via an application.
List of DDL commands:
• CREATE: This command is used to create the database or its objects
(like table, index, function, views, store procedure, and triggers).
• DROP: This command is used to delete objects from the database.
• ALTER: This is used to alter the structure of the database.
• TRUNCATE: This is used to remove all records from a table, including
all spaces allocated for the records are removed.
• COMMENT: This is used to add comments to the data dictionary.
• RENAME: This is used to rename an object existing in the database.
3 ANS):
1. Internal Level
o The internal level has an internal schema which describes the physical storage structure of the
database.
o It uses the physical data model. It is used to define that how the data will be stored in a block.
o The physical level is used to describe complex low-level data structures in detail.
Skip Ad
o Access paths.
For Example: Specification of primary and secondary keys, indexes, pointers and sequencing.
2. Conceptual Level
o The conceptual schema describes the design of a database at the conceptual level. Conceptual
level is also known as logical level.
o The conceptual level describes what data are to be stored in the database and also describes
what relationship exists among those data.
o In the conceptual level, internal details such as an implementation of the data structure are
hidden.
3. External Level
o At the external level, a database contains several schemas that sometimes called as subschema.
The subschema is used to describe the different view of the database.
o Each view schema describes the database part that a particular user group is interested and
hides the remaining database from that user group.
5 ANS):
1. Query Processor :
It interprets the requests (queries) received from end user via an application
program into instructions. It also executes the user request which is received
from the DML compiler.
Query Processor contains the following components –
• DML Compiler –
It processes the DML statements into low level instruction (machine
language), so that they can be executed.
• DDL Interpreter –
It processes the DDL statements into a set of table containing meta
data (data about data).
• Query Optimizer –
It executes the instruction generated by DML Compiler.
2. Storage Manager :
Storage Manager is a program that provides an interface between the data
stored in the database and the queries received. It is also known as Database
Control System. It maintains the consistency and integrity of the database by
applying the constraints and executes the DCL statements. It is responsible for
updating, storing, deleting, and retrieving data in the database.
It contains the following components –
• Authorization Manager –
It ensures role-based access control, i.e,. checks whether the
particular person is privileged to perform the requested operation or
not.
• Integrity Manager –
It checks the integrity constraints when the database is modified.
• Transaction Manager –
It controls concurrent access by performing the operations in a
scheduled way that it receives the transaction. Thus, it ensures that
the database remains in the consistent state before and after the
execution of a transaction.
• File Manager –
It manages the file space and the data structure used to represent
information in the database.
• Buffer Manager –
It is responsible for cache memory and the transfer of data between
the secondary storage and main memory.
3. Disk Storage :
It contains the following components –
• Data Files –
It stores the data.
• Data Dictionary –
It contains the information about the structure of any database object.
It is the repository of information that governs the metadata.
• Indices –
It provides faster retrieval of data item.
7 ANS):
It organizes records in
To organize records, it the form of directed It organizes records in the
uses tree structure. graphs. form of tables.
1 ANS):
Super Key:
Super Key is an attribute (or set of attributes) that is used to uniquely identifies
all attributes in a relation. All super keys can’t be candidate keys but its reverse
is true. In a relation, number of super keys are more than number of candidate
keys
Candidate Key:
Candidate key is a set of attributes (or attribute) which uniquely identify the
tuples in a relation or table. As we know that Primary key is a minimal super
key, so there is one and only one primary key in any relation but there is more
than one candidate key can take place. Candidate key’s attributes can contain
NULL value which oppose to the primary key.
Primary Key:
Candidate key is a set of attributes (or attribute) which uniquely identify the
tuples in a relation or table. There can be more than one candidate key in
relation out of which one can be chosen as the primary key.
2ANS):
RA ,RC.pdf
3ANS):
3. Intersect
4. Minus
1. Union
o The SQL Union operation is used to combine the result of two or more SQL SELECT queries.
o In the union operation, all the number of datatype and columns must be same in both the
tables on which UNION operation is being applied.
o The union operation eliminates the duplicate rows from its resultset.
Syntax:
2. Union All
Union All operation is equal to the Union operation. It returns the set without removing
duplication and sorting the data.
Syntax:
3. Intersect
o It is used to combine two SELECT statements. The Intersect operation returns the common
rows from both the SELECT statements.
o In the Intersect operation, the number of datatype and columns must be the same.
Syntax
Syntax:
4 ANS):
Relational Calculus
o Relational calculus is a non-procedural query language. In the non-procedural query language,
the user is concerned with the details of how to obtain the end results.
o The relational calculus tells what to do but never explains how to do.
Notation:
Where
o Domain relational calculus uses the same operators as tuple calculus. It uses logical connectives
∧ (and), ∨ (or) and ┓ (not).
o It uses Existential (∃) and Universal Quantifiers (∀) to bind the variable.
Notation:
5ANS ):
https://www.geeksforgeeks.org/set-theory-operations-in-relational-
algebra/
6ANS):
https://www.geeksforgeeks.org/sql-correlated-
subqueries/#:~:text=With%20a%20normal%20nested%20subquery%2C%20the%20inne
r%20SELECT,inner%20query%20is%20driven%20by%20the%20outer%20query.