DBMSAll Chapter Notes
DBMSAll Chapter Notes
Chapter – 1
Introduction to Database Management System
2) Insulation between programs and data, and data abstraction:- Database approach
ensures program- data independence. A characteristic that permits programs-data
independence is termed as ―Data Abstraction‖ accordingly; the data model is type of data
abstraction.
- DBMS provides users with the conceptual representation of data that does not include
many of the details of how data is stored and implemented.
3) Support of Multiple Views of the Data: - A database typically has many users, each
of whom may require a different view of the database. A view may be a subset of the
database or it may contain virtual data. That is derived from the database files but is not
explicitly stored.
- Some users may not need to be aware of whether the data they refer to is stored or
derived.
- The multiuser DBMS whose users have a variety of distinct applications must provide
facilities for defining multiple views.
1
Written By: Mahesh, Nitin, Sunil.
Database Management System
- DBMS must include ―Concurrency Control‖ when multiple applications access same
sets of data simultaneously (multi user DBMS) and also it is software to ensure that
several users trying to update the same data do so in a controlled manner so that the result
of the updates is correct
- For example, when several reservation clerks try to assign a seat on an airline flight, the
DBMS should ensure that each seat can be accessed by only one clerk at a time for
assignment to a passenger.
- These types of applications are generally called ‗Online transaction process (OLTP)‘.
3) Who are Actors on the Scene? Explain in detail the roles of each actor in DBMS.
[2012, 2014, 2015]
Ans: - The people involved in the design, use and maintenance of large database with
hundreds of users. We called them as Actors on the Scene.
Actors are:
1) Database Administrators: - The DBA is responsible for authorizing access to the
database, coordinating and monitoring its use and acquiring software and hardware
resources as needed.
- DBA is single person to manage the databases of typically large establishments. He has
administered the co-ordinate use of resource of database system environment.
Functions of DBA: - a) Authorize access to database.
b) Facilitate co-ordinate use of database.
c) Install an upgrade DBMS and application Tools.
2) Database Designers: - Database designers are responsible for identifying the data to
be stored in the database and for choosing appropriate structures to represent and store
this data.
- It is the responsibility of database designers to communicate with all prospective
database users in order to understand their requirements and to create a design that meets
these requirements.
- Database designers develop and finalize database model and database designers must
ensure that the proposed model is capable of supporting real-world system in many
aspects.
Database designers typically interact with each potential group of users and develop
views of the database that meet the data and processing requirements of these groups.
3) End Users:- These are the people whose jobs is to access the database for querying,
updating, and generating reports, the database primarily exist for their use.
2
Written By: Mahesh, Nitin, Sunil.
Database Management System
b) Parametric end users: - This makes up a sizable portion of database end users. Their
main job function revolves around constantly querying and updating the database, using
standard types of queries and updates—called canned transactions—that have been
carefully programmed and tested. The tasks that such users perform are varied:
- A Bank tellers check account balances and post withdrawals and deposits. Reservation
clerks for airlines, hotels, and car rental companies check availability for a given request
and make reservations.
c) Stand-alone end users: - Maintain the personal database by using readymade program
package that provide easy-to-use provided by the DBMS.
For example: Income tax assessment software package- to file tax return on annual
income of an individual.
d) Sophisticated End User: include engineers, scientists, business analysts and other
who thoroughly familiarize themselves with the facilities of the DBMS in order to
implement applications to meet complex requirements.
2) Tool Developers: - This is person who develops and implements various software
tools & utilities that help assist the database, testing and its trial usages for performance
monitoring.
3
Written By: Mahesh, Nitin, Sunil.
Database Management System
4
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 2
Database System Concepts and Architecture
i) Low level or Physical data models: They provide concepts about physical storage of
data i.e. how to store data in a computer hard disk. They specify about record formats,
record ordering and access paths etc.
- Low level data model details are generally meant for computer scientists, not for typical
end users.
- This data models make search for a particular database in DBMS
Examples: Heaps, ISAM, VSAM, and Hash.
-Foreign keys are used to identify relationships between tables.
ii) High level or Conceptual data model: These models are also referred as Logical data
models. They provide concepts for typical end users at high level i.e., that are
independent of physical storage.
- Conceptual data model use concept such as entities, attributes and relationships.
Attribute: It represent the some properties of entity such as employee‘s salary or name.
- Accordingly, High level data models provide concepts such as entities, attributes,
relationship and data structures etc. High level data model details can be easily
understood by typical end users.
- The context of data models categories give rise to third variety of data models called
‗Representational data models‘. They are also termed as Implementation models.
- These representational data model can broadly be considered as belong to High level or
logical data models as they provide concepts that may be easily understood by end users.
iii) Representational or Implementation Data model: It refers to concepts and here the
data are not changed, that are fixed & this cannot be re-implemented by end-users.
- This models are used most frequently in traditional commercial DBMSs. These include
widely used relational data model.
5
Written By: Mahesh, Nitin, Sunil.
Database Management System
a) The Internal schema at physical level (internal level):- It is lowest level of data
abstractions defining the physical storage structure of the database.
- Which describes the physical storage structure of the database. The internal schema uses
a physical data model and describes the complete details of data storage and access paths
for the database.
- Usually, a representational data model is used to describe the conceptual schema when a
database system is implemented. This implementation conceptual schema is often based
on a conceptual schema design in a high-level data model.
c) The external schema at View level (External level): It is highest level of abstraction
defining only part of database.
- It includes a number of external schemas or user views. Each external schema describes
the part of the database that particular user group is interested in and hides the rest of the
database from that user group.
- This level of abstraction simplifies end user‘s interaction with database system.
5) Define Data Independence and Explain Logical and Physical data independence.
Ans: - Data Independence:- It is defined as the capacity to change the schema at one
level of a database system without having to change the schema at the next higher level.
6) Explain all DBMS Languages (DDL, DML, SDL, and VDL). [2012, 2015, 2016]
Ans: - i) DDL (Data definition languages):- It is used by DBA and by database
designers to define to define both schemas.
- The DBMS will have DDL compiler whose function is to process DDL statement in
order to identify description of schema and to store the schema description in DBMS
catalog.
- CREATE - to create objects in the database
- ALTER - alters the structure of the database
7
Written By: Mahesh, Nitin, Sunil.
Database Management System
ii) DML (Data manipulation language):- Statements are used for managing data within
schema objects.
- Typical manipulations include retrieval, insertion and deletion of data. The DBMS
provides set of operations or languages called Data manipulation language (DML).
- SELECT - Retrieve data from the database
- INSERT - Insert data into a table
- UPDATE - Updates existing data within a table
- DELETE - deletes all records from a table
iii) SDL (Storage Definition Language):- It is used to specify the internal schema. The
mapping between two schemas may be specified in either one of these languages.
iv) TCL (Transaction Control Language):- Statements are used to manage the changes
made by DML statements. It allows statements to be grouped together into logical
transactions.
Some examples:
- COMMIT - Save the work permanently
- SAVEPOINT - identify a point in a transaction to which you can later roll back
- ROLLBACK - restore database to original since the last COMMIT.
8
Written By: Mahesh, Nitin, Sunil.
Database Management System
9
Written By: Mahesh, Nitin, Sunil.
Database Management System
b) SDL (Storage definition language):- It is used to specify the internal schema and
SDL is used to store the internal schema.
- In most of the relational DBMS today, there is no specific language that performs the
role of SDL, instead, the internal schema is specified by combination of parameters and
specifications related to storage.
c) VDL (View definition Language):- It is to specify user views and their mappings to
the conceptual schema.SQL are used in the VDL to define user or applications views as
results of predefined queries.
11
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 3
Data Modeling using Entity- Relationship Model
2) What is ER model?
Ans:- It is high level conceptual data model. This model & its variations are frequently
used for the conceptual design of database applications.ER model is used to represent
Real-World objects called entities.
3) Explain Entity, Entity types, Entities sets, Attributes and Keys: [2012, 2015]
Ans:- a) Entities:- An entities can be any object place, person, house, car, employee and
class.
-It represents using the rectangular box.
b) Entity SET: It is a set of entities of the same entity type. So a set of one or more
Entities of Student Entity type is an Entity Set.
For example: in table STUDENT id, name and Age are properties of an entity of entity
type student. Hence these are attributes.
12
Written By: Mahesh, Nitin, Sunil.
Database Management System
Types of Attributes:
a) Simple attribute: - Simple attributes are atomic values, which cannot be divided
further into subparts.
For example:- A student's phone number is an atomic value of 10 digits.
13
Written By: Mahesh, Nitin, Sunil.
Database Management System
c) Derived attribute:- Derived attributes are the attributes that do not exist in the
physical database, but their values are derived from other attributes present in the
database.
For example: average_salary in a department should not be saved directly in the
database, instead, it can be derived. For another example, age can be derived from
data_of_birth.
e) Multi-valued attribute:- Multi-valued attributes may contain more than one values.
For example:- A person can have more than one phone number, email address, etc..
f) Key Attribute:- The key attribute represents the main characteristic of an Entity. It is
used to represent the Primary key. Oval shaped with underlying lines represent Key
Attribute.
14
Written By: Mahesh, Nitin, Sunil.
Database Management System
g) Complex Attribute: A complex attribute exist when nesting and /or grouping of
composite attribute along with multi-valued attribute takes place.
For example:- A company CEO has multiple contact phone no at one or more locations.
So locations address as composite attribute and contact phone no valued to be displayed
(with braces{}).
15
Written By: Mahesh, Nitin, Sunil.
Database Management System
c) Many-to-one: When more than one instance of an entity is associated with the
relationship, it is marked as N:1'.
16
Written By: Mahesh, Nitin, Sunil.
Database Management System
17
Written By: Mahesh, Nitin, Sunil.
Database Management System
b) Binary:- Relationship of degree two are termed as Binary. It involved two entity
types.
Ex:- faculty member have specification in qualification of engineering courses. Such as
CS, Is E&C etc…
18
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 4
Record Storage and File Organization
19
Written By: Mahesh, Nitin, Sunil.
Database Management System
- For Heap file ‗fixed-length‘ records using un-spanned blocks it is straight forward
approach to access any record by its position in the file.
Algorithm
It can be used to calculate the hash address.
20
Written By: Mahesh, Nitin, Sunil.
Database Management System
2) External Hashing:- Hashing for disk file is called external hashing. To suit the
characteristics of disk storage, the target address space is made of Buckets. Each of which
holds multiple records.
- A bucket is either one disk block or cluster of contiguous block. The hashing function
maps the key into relative bucket number.
- The collision problem is less severe with buckets, because as many records as will fit in
bucket can hash to the same bucket without causing problem.
- The pointer in the linked list should be records pointers, which include both a block and
relative record position within a block.
- Hashing provides fastest possible access for retrieving arbitrary record given value of its
hash field.
Data stripping:- It utilizes the parallelism to improve disk performance. Data stripping
distribute data transparency over multiple disks to make them appear as single large, fast
disk.
21
Written By: Mahesh, Nitin, Sunil.
Database Management System
22
Written By: Mahesh, Nitin, Sunil.
Database Management System
data ware houses that keep historical aggregate information, the demand for storage has
gone up substantially.
- Many users of RAID system cannot use the capacity effectively because it has to be
attached in a fixed manner to one or more server. Therefore, large organizations are
moving to concept called ‗Storage Area Network‘.
- In SAN online storage peripherals are configured as nodes on a high-speed network and
can be attached & detached from servers in very flexible manner.
Advantages of SAN:
i) Flexible many-to-many connectivity among servers and storage devices using fibre
channel hubs
ii) up to 10 km separation between capabilities between a server and storage system using
appropriate fiber optic cables.
2) Network Attached Network (NAS):- NAS devices allow vast amount of hard disk
storage space to add to network and can make that space available to multiple servers
without shutting them down for maintenance and upgrades.
- The need for high performance storage at low cost has become extremely important.
Network-attached storage (NAS) devices are used for this purpose.
- NAS devices reside anywhere in on LAN and may be combined in different
configurations.
- A single hardware device, often called NAS box or NAS head, acts as interface between
NAS system and network Clients.
- This NAS devices require no monitor, keyboard or mouse. One or more disk or tapes
drivers can be attached to many NAS systems to increase total capacity.
i) Magnetic Disk:- This are used storing large amount of data. The most basic unit of
data on the disk is single bit of information. All disks are made of magnetic material
shaped as a thin circular disk, as shown below diagram.
Diagram:
23
Written By: Mahesh, Nitin, Sunil.
Database Management System
- A disk is single sided if it stores information on one of its surfaces only and double-
sided if both surfaces are used.
- Each circle is called track. In packs, tracks with the same diameter on the various
surfaces are called as cylinder because of shape.
- The number of tracks on the disk ranges from few hundred to a few thousand, and
capacity of each track ranges from tens of Kbytes to 150 Kbytes.
- The division of track into sectors is hard-coded on the disk surface and cannot be
changed.
-The division of track into equal-sized disk block is set by the operating during disk
formatting.
- The actual hardware mechanism that reads or writes block is disk read/write head,
which is part of system called disk drive.
- Contiguous blocks called a cluster.
ii) Magnetic Tape:- It looks like tape used in ‗Music Cassets‘ it is plastic tape with a
magnetic coating on it. The data stored in form of tiny segments of magnetized and
de- magnetized portions on the surface of material.
- Magnetic tapes are sequential access devices; to access the nth block on the tape.
- Data records on the tape are also stored in blocks. The main characteristic of tape is its
requirement that we access the data blocks in sequential order.
- Magnetic portion refers to value 1. and de-magnetic portion refers to value 0.
Different sizes: a) ½ inches wide tape
b) ¼ inches wide tape
- Magnetic tape units:- This are capable of reading and writing data.
- Speed: 50 inches/sec> speed > 100 inches /sec
Advantages:
1) Durable and reused
2) Least expensive
3) It is reliable storage medium
4) Data transfer can be increasing speed of the tape.
24
Written By: Mahesh, Nitin, Sunil.
Database Management System
Disadvantages:
1) It needs to be Revised or updated often
2) It needs to be Rewind the tape to the position where required data starts.
3) It is slow.
25
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 5
Functional Dependencies and Normalization for Relation Database
2) Reducing the Redundant Values in Tuples:- The goal of this schema is to minimize
the storage space used by the base relation.
- Grouping attributes into relation schemas has a significant effect on storage space.
- Optimum storage utilization is another important objective of designing and storing
relation schemas as base relations (base tables or files).
- That is storage space should not be consumed unnecessarily for storing redundant data.
- For instance, consider the following two relation schemas as EMPLOYEE and
DEPARTMENT.
- A new relation schema called DEPT_EMPLOYEES is formulated by a grouping of
attributes drawn from both EMPLOYEE and DEPARTMENT relation schemas. This is
shown in figure. EMPLOYEE:
EMP -NO NAME DOB SALARY ADDRESS DEPT-ID
DEPARTMENT:
DEPT-NUM DEPT-NAME HOD-ID DEPT-LOCATION.
DEPT-EMPLOYEES:
EMP -NO NAME DOB SALARY DEPT-ID DEPT-NAME DEPT-LOCATION
- The relation DEPT-EMPLOYEES would cause serious redundancy storage problem if
atleast 5 to 10 employees are working in each (different) department.
- That is for ‗n‘ number of employees working for the same department the values for
DEPT-ID, DEPT-NAME and DEPT-LOCATION remains same and will be repeated n
times!!
26
Written By: Mahesh, Nitin, Sunil.
Database Management System
EMP_DEPT:
Ename Ssn Bdata Address Dno Dname Dmgr_ssn
Rajesh 234346 09-02-1990 #736 Hosur 6 Research 333444666
Shyam 72772 8-07-1997 Gdg 6 Research 333444666
Ram 999888 17-04-1993 #a, Haveri. 4 Admin 783387383
Subhas 983363 30-09-1990 331, castilerock 4 Admin 44332222
987, rice
Houstn
Update Anomalies:-
- The Update anomalies can be classified as:
i) Insertion Anomalies:- Insertion anomalies can be differentiated into 2 types
- To insert new employee tuple into EMP_DEPT, we must include either the attribute
values for the dept that employee works for, or NULL.
- For example, to insert new tuple for an employee who works in dept number 4, we must
enter attribute values of dept 4 correctly so they consistent with values for dept 4 in other
tuples in EMP_DEPT.
ii) Deletion Anomalies: Assuming a single employee is working for the department such
as RESEARCH, while other tuples have been deleted previously.
- Now deleting this last tuple also erases the existence of a particular department from
DEPT-EMPLOYEES relation.
- Such irregularity may not occur in the database of above figure is employed. Since
tuples pertaining to department exist separately in DEPARTMENT table although none
of the employees is working for it.
iv) Minimising the Null Values in Tuples:- While designing the relation schema, if we
are not sure about certain attribute values or the chosen attribute is not distinct from
others then many tuples while insertion operations, may have to assume NULL values
only.
- This would lead to the problems of wastage of storage space, little or no understanding
of the tuples (what they would actually mean 7) etc...
27
Written By: Mahesh, Nitin, Sunil.
Database Management System
Design Guideline # 3 :
@ Design the relation schema such that all of its attributes assume distinct values other
than NULL values.
@ If at all NULL values are to be used for a particular attribute, it must be in exceptional
cases only and for only a few tuples.
- Can generate a number of invalid tuples or fake tuples which inturn may result into
wrong information for the user/s when he or she queries such tables or relations.
- For example ADDRESS and DEPT-LOCATION may lead to confusing at, but values
as employee address and location of project or department located at the employee
located at etc.,
3) What is Normalization? Explain 1NF, 2NF and 3NF. [2012, 2014, 2015, 2016]
Ans:- Normalisation of data can be considered a process of analysing the given test
schemas based on their FDs and primary keys to achieving the desirable properties
(1) minimising redundancy and (2) minimising the insertion, deletion, and update
anomalies.
- Thus, the normalization procedure provides database designers with the following:
28
Written By: Mahesh, Nitin, Sunil.
Database Management System
i) A formal framework for analyzing relation schemas based on their keys and on the
functional dependencies among their attributes.
ii) A series of normal form tests that can be carried out on individual relation schemas so
that the relational database can be normalized to any desired degree
Definition:- The normal form of a relation refers to the highest normal form condition
that it meets, and hence indicates the degree to which it has been normalised.
NORMAL FORMS:
i) First Normal Form (1NF):- A relation R is said to be in First Normal Form (INF) if
the domain of attributes for each and every tuple contains atomic values and every such
attribute assume a single value only.
- Thus the attributes values that can be recorded for tuples of relations in First Normal
Form (1NF) are atomic, single-valued.
- Accordingly, the first normal form suggests that a relation have tuples with a primary
key and attribute values are indivisible further.
- A department can have multiple locations or branches. Therefore the relation is not in
1NF. Since DEPT_LOCATION attribute value is multivalued.
- Thus move the repeating group of values by creating another table/relation such as
EMP-LOCATION and original as EMPLOYEE.
- Even we can remove F-NAME attribute column and DEPT_NUM- attribute field from
EMP_LOCATION relation.
ii) Second Normal Form (2NF):- A relation R is said to be Second Normal Form(2NF) if
and only if it is in 1NF & every non-key attribute is fully (functionally) dependent on
primary key.
- In otherwords, for a table or relation to be in Second Normal form, every non-key field
(attribute) must depend on the entire primary key, not on part of a composite primary
key.
- Therefore, if the database consists of relations or tables that have only single-field
(attribute) primary keys.
29
Written By: Mahesh, Nitin, Sunil.
Database Management System
- For instance, in the following table EMPLOYEE-DEPT, the primary key is a composite
key on EMP-ID and DEPT-NUM. However, value of the DEPT-NAME depends only on
DEPT_NUM boy not entire.
Primary Key
EMP_id DEPT_NUM DEPT_NAME
4030 212 DRDO
2017 101 ISRO
6020 212 DRDO
1140 177 HAL
EMPLOYEE_DEPT: A table that violates 2NF
EMP_id DEPT_NUM
4030 212
2017 101
6020 212
1140 177
DEPT_NUM DEPT_NAME
212 DRDO
101 ISRO
212 DRDO
177 HAL
iii) Third Normal Form (3NF):- A relation R is said to be Third Normal Form (3NF), if
and only if it is 2NF & non-key field (attribute) should not be determined by another non-
key field.
OR
- A relation R is said to be Third Normal Form (3NF), if there exist a Non-trivial function
dependency (FD)XA holds in R, either X is super key of R or A is prime attribute of R.
- In other worlds, a non-key field cannot depend on another non-key field in a given
relation R.
- 3NF is based on eliminating ‗Transitive Dependency‘
30
Written By: Mahesh, Nitin, Sunil.
Database Management System
STUDENT:
REG-NO NAME CLASS TELEPHONE
- The TELEPHONE number is as good as CONTACT-ID that distinguish each and every
student. No we assume that REG-NO, NAME and TELEPHONE attributes are distinct
(unique).
- Now the following functional dependencies can be drawn for the STUDENT relation:
fd1: REG-NO NAME
fd2: REG-NO CLASS
fd3: REG-NOTELEPHONE
fd4: NAMECLASS
fd5: NAMETELEPHONE
fd6: TELEPHONE REG-NO
- Now the STUDENT relation is said to be in BCNF, since all fd‘s contain a candidate key as
the determinant(left hand side).
31
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 6
Relational Data Model Concepts and Relation Algebra
Characteristics of Relation:
i) Tuple in a given relation need not to be ordered (where as rows of a given table appears
in same order)
ii) Attribute value in given tuple must be atomic; therefore multivalue attribute must be
represented as separate relations.
iii) Similarly composite attributes are represented by respective composite attributes
iv) Null- a special value is used to denote unknown/undefined values of certain attributes
within a given tuple.
3 catagories:
i) Inherent Data Model-based Constraints:- For instance a relation with restriction that
it cannot have same or duplicate tuples, represent a constraint that is inherent in data
model.
ii) Schema - based Constraints:- For instance constraints can be directly specified in the
schema of data model. Via:DDL.
iii) Application -based Constraints: For instance constraints cannot be enforced directly
in the schema of data model.
- They must be associated & enforced well within application program that implement
given database.
32
Written By: Mahesh, Nitin, Sunil.
Database Management System
3) Explain Key Constraints (key, Candidate key, super key, foreign key). [2014, 2015]
Ans:- An elegant approach to locate distinct tuples that are unique in a relation is to employe
keys.
i) Key: A key is that property of an attribute in given relation, from which one cannot remove
any attribute till such time the uniqueness property or constraint is maintained.
For ex:- REG_NO in STUDENT relation
EMPLOYEE_ID in a EMPLOYEE relation
ii) Candidate Key:- In given relation, there can be more than one attribute that can identify
each tuple uniquely.
- These attributes form candidate keys.
For ex: employee‘s PPF account no serve as candidate key in addition to original or base key.
iii) Primary Key:- A designated key among candidate key is termed Primary key.
For ex:- REG_NO, Emp_Id etc..
iv) Super Key:- A super key is defend as super set of candidate keys. Super key has the
uniqueness and it can also contain redundant attributes.
- For instance, in given relation there can be subsets of attributes with property or key
constraint that two tuples can have same set of values.
v) Foreign Key:- A foreign key is a set of attributes say in relation schema R1 that finds
match as primary key attributes PK of relation schema R2.
- In otherwords, attributes in foreign key of R1 , expects or observes same domain values as
the attributes in primary key in R2.
- Also, foreign key value in some tuple t1 of relation R2 either finds value of primary key in
other tuple t2.
Ans:- i) Entity Integrity Constraints:- It suggest that the participating key value of base
Relation should not be Null value. Because it is primary key value that uniquely identifies or
locate individual tuple distinctly.
- Therefore it should not be Null.
33
Written By: Mahesh, Nitin, Sunil.
Database Management System
ii) Referential Integrity Constraints: It suggest that foreign key value in refereeing relation
R1 must find a matching primary key value in some tuple of the referenced relation R2
- To conclude, key constraint & entity integrity constraints are defined on individual relation.
- Where as referential integrity constraints are defined between two relations say R1 & R2.
Relational Algebra
R1<><join cond>R2
ii) Equi Join:- ―If the comparison operator in join condition s equality(=) then such join
operation is termed as Equi Join‖ (i.e Ɵ is =).
iii) Natural Join(*) :- ― The natural join operation is essential an EQUI JOIN operation with
the removal of redundant attributes holding same values.‖
R1* <join condition> R2 or R1 * R2
iv) Theta Join (Ɵ):- ―A join operation with general join condition as <condition> AND
<condition> AND <condition> ….. Where in each <condition> is of the form Ai Ɵ Bi and Ɵ
happens to be one of the comparison operators.
c) Set Deference (-) : The set difference of R1 and R2 denoted as (R1-R2) is relation
comprising all tuples of R1 but not present in R2.
34
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter – 7
Relational Database Languages (SQL)
35
Written By: Mahesh, Nitin, Sunil.
Database Management System
Chapter - 9
Transaction Processing Concepts Concurrency Control Technique
4) Durability:- The changes if any, made to the database by a committed transaction must
continue to exist permanently, even in case of system failures.
- It‘s the responsibility of the recovery mechanism of DBMS to ensure the durability of the
database, which is currently subjected to number of transaction executions.
36
Written By: Mahesh, Nitin, Sunil.
Database Management System
1) Binary Locks:- As the name itself indicates it has two states i.e. Locked(1) and
Unlocked(0).
- The operations associated with Binary Locking system are
i) Lock – item(x)
ii) Unlock – item(x)
- Whenever, transaction would like to access a database item X, it first issues an operation
execution: lock-item (x).
- However, if items X is free to use i.e. unlocked i.e. LOCK (X) = 0
2) Shared Locks (read locks):- This locks are used for ―read-only‖ purposes. It is also called
shared locks, since more than one transaction can read an item of the data at same time.
3) Exclusive Locks (write- locks):- Used for Possible modification/ update operation on item
of the database including reading.
- They are used exclusively for single transaction to hold the lock on the item to be written/
updated.
37
Written By: Mahesh, Nitin, Sunil.
Database Management System
1. (a) What is database? Explain the characteristics of the database approach. (10+6=16)
(b) Discuss the actors on the scene.
2. (a) What is a data model? Discuss the different categories of data models. (8+8=16)
(b) Discuss in detail the DBMs languages.
5. (a) Discuss the, Informal design guidelines for relational schemas. (8+8=16)
(b) What is normalization? Discuss first normal form, second normal form and third
normal form
7. (a) Explain with their syntax different DML communion SQL. (8+8=16)
(b) What is a procedure? Discuss the syntax for creating a procedure in PL/SQL.
38
Written By: Mahesh, Nitin, Sunil.
Database Management System
III. a) Define attribute. Explain different types of attributes with example. (8+4+4=16)
b) Define the terms
i) Entity
ii) Relationship type with example
c) Cardinality ratio and participation constraints with example.
V. a) Define functional dependency. Explain INF and 2NF with example. (8+8=16)
b) Explain:
i) Insertion Anomalies
ii) Deletion Anomalies Modification Anomalies.
c) Define
i) Key
ii) Candidate key with example.
39
Written By: Mahesh, Nitin, Sunil.
Database Management System
40
Written By: Mahesh, Nitin, Sunil.
Database Management System
5076-E23-VSBCA-N-15
B.C.A. DEGREE EXAMINATION NIOVEMBER 2015.
Fifth Semester
DATABASE MANAGEMENT SYSTEM
THEORY
Time: Three hours
Maximum: 80 marks
2. (a) Describe the three schema architecture. Why do we need mapping between schema
levels?
(b) Define the following:
i) DDL
ii) SDL
iii) VDL
iv) DML
(8 + 8 = 16)
3. a) What 'is an entity type? What is an entity set? Explain the differences among an
entity, an entity type and an entity set.
b) Differentiate
(i) Composite Versus Simple, attribute
(ii) Single valued versus multi valued attributes
(iii) Stored valued versus derived attributes
(c) Define the following:
(i) Weak Entity
(ii) Primary key
(8+6+2=16)
4. (a) Explain the different operations on file.
(b) Explain the concept of buffering of blocks.
(c) What is RAID? Explain briefly. (8+4+4=16)
41
Written By: Mahesh, Nitin, Sunil.
Database Management System
7. (a) What is Cursor? Explain the concept of cursor with example. (6+8+2=16)
(b) Explain the following definition with example:
(i) CREATE
(ii) ALTER
(iii) DROP
(iv) UPDATE
(c) What is Transaction Processing?
42
Written By: Mahesh, Nitin, Sunil.
Database Management System
6. a) What is Normalization? When can you say that relation is in normal form?
Explain INF, 2NF, 3NFI.
b) Explain following commands:
i) Alter
ii) Update
iii) Insert
(8+8=16)
43
Written By: Mahesh, Nitin, Sunil.
Database Management System
44
Written By: Mahesh, Nitin, Sunil.