0% found this document useful (0 votes)
19 views

Dbms Database and System Applications

DBMS stands for Database Management System. It is software that performs functions like defining and maintaining the database, supporting data storage and retrieval operations, enforcing data integrity and security rules, and providing recovery from failures and concurrency control. The goals of DBMS are to support system activities, perform monitoring and tuning, and support backup and recovery. The advantages of DBMS include improved data sharing, data independence, reduced data redundancy, improved data consistency, and enforcement of standards.

Uploaded by

KRISHNA SRIKONDA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Dbms Database and System Applications

DBMS stands for Database Management System. It is software that performs functions like defining and maintaining the database, supporting data storage and retrieval operations, enforcing data integrity and security rules, and providing recovery from failures and concurrency control. The goals of DBMS are to support system activities, perform monitoring and tuning, and support backup and recovery. The advantages of DBMS include improved data sharing, data independence, reduced data redundancy, improved data consistency, and enforcement of standards.

Uploaded by

KRISHNA SRIKONDA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Win

UNIT DATABASE SYSTEM


APPLICATIONS, INTRODUCTION
TO DATABASE DESIGN a
SIA GROUP

R9VE r33eloE1 (
PART-A
SHORT QUESTIONS WITH SOLUTIONS
MWhat is DBMS? What are the goals and advantages
of DBMS?
o0 OR

What is DBMS? What are the goals of DBMS?


Refer Only Topies: DBMS,
Goals of DBMS)
eglc p ae May-17[R15), 01(a)

.2
OR gnoapgeiail
What is DBMS? What are the advantages of DBMS?
Refer Only Topics: DBMS,
Advantages of DBMS) o
Answer
May-19(R16), 01(a)
DBMS

Database
Management System (DBMS) is a software that performs
the following functions,
Defining a database
Supporting query language
Producing reports
Creating data entry screens.
Goals
of DBMS

9losupport system activities.


Pom
To per
monitoring and turning so as to ensure satisfactory performance level. g
POrm
To
backup and recovery activities inorder to recover from disaster
carr
ADvantages ecurity auditing and monitoring that deals with the assignment of access rights and use of access privileges.
of DBMS
0 Prop
gram data independencee
Reduced
dataredundancy
nproved data
consistency
mproved data
Enforcement
sharing feoit
dsly
Improved of standar
lards
quality
M ALL-IN-ONE
JOUR AL FOR ENGINEERING STUDENTS SIA GROUP
Cuon to
ase SysIem ApPcatuoils
Database Design
1.3
Date
te between
TJNTU-HYDEP
TU-HYDERABAD between schema and data model.
MANAGEMENT SYSTEMS Differentiate
1.2 DATABASE May-15(R13), 01(a)

Q2. List the disadvantages of DBMS. Model Paper-l, Schema Data Model
Q1
Answer design of the
represents tne overall Data model represents a model which is used for
he disadvantages of DBMS are as follows, schema modeling the data of a database.
A
database
High conversion cost are catego as, Data models are categorized as,
2. High management and installation cost Databaseschemas
) High level data model
5. Need of new specialized personnel Internmalschema
. Need for explicit backup and recovery
(0
onceptual schema
(i) Low level data modelar
n
. Security breaches External schema
Q3. Write down the applications of DBMS. (ii) In data model, data can be clearly understood by
Nov./Dec.-18(R16), 91(b)
hema, data
schen can be understood by analogy to a
Answer In a
program written in progrämming language. its figure.
Applications or ne applications required. Physical implementation is not required.
either directly or indirectly.
SOme
Physical
implementation is

gent systems are used by many individuals


of custom programs to process data.
DBMS are listed below
Explain
the advantages of using a query language instead
07. AprilMay-12, Set-2, 01(a)
) Transactions in Bank individual
database stores tne detals of
debiting the account. The bank custom programs are as
ser accesses bank database
the
customers, their account, etc.
for crediting or
loans The advantages
adv
of using the query language (of
relational model) to process the data instead of

Gi) Reserved Ticket Reservation follows, whereas the custom


form of queries which are easily understandable
information and to reserve the ticket. language allows to post the questions in the
Database of airlines is used to schedule oniy one request and
The query
of posting the questions.
a last seat at the same time, the database
should accept programming does not includes the idea
Suppose, if two travelling agents compete for logic without the need of
any custom pro-
inform the other that his request cannot be accepted. A query language such as relational
calculus allows to perform mathematical
(iii) Students at Universities gramming code.
and a database for the faculty and students. Each student
record predefined operations to manipulate the
Universities have database of various courses they offer faculty record contains the name of faculty, his employee id Aquery language such as relational
algebra is similar to calculus and includes the perform any sort of
to create the code explicitly in order to
contains the name of the student, marks scored
etc. Each
relations whereas in custom programming the user requires
Salary, subjects dealing with etc manipulations.
operations instead it
Write disadvantages of file system. optimizing and performing of the physical
Q4. is not bothered about planning, in the custom programming all
such
Ihe relational language Management System (DBMS) whereas
Answer eaves this responsibility on the Database
follows, dtko F Tasks are needed to be performed explicitly.
The disadvantage of file system are as to
accessed more than 4 GB. This is due
the computer system has main memory of S00 GB then also the data cannot be Q6. What is a descriptive attribute? Explain.
1. If presence of many directories.
the S Wer :
concurrently by different users and frequent changes, are made by
The data is prone to security attackS iI t
1s accessed
Descriptive
them. Attribute information regarding
1These attributes record the
or crash then the data cannot be restored (or) backup with a relationship. These entities upiquely
1dentaly
When the changes are made to the system, at that 1ime hard disk c atributes are the attributes associated the participating entities.
insuficienl, the resneeti but not about
about any
any of
username seCurity purpose to in. This also becomes insulie
sign in. Tespective it is defined
The operating system provides the and password for
suheet Sgn relationshi relationship
nship on which
users have permission to access various data Ship without using descriptive attributes
Decause different
5. Itdoes not restrict the unauthorized acces5,
f n ytst ahe gh
s
programmers develop large amount of code. These codes are nothing but special programs which server thems
Example

Jdate Cid Chame


Caddress
6. 1 he to each question raiSea Dy uscS OprngConcurenty, This inereases the complexity. Sid Sname

What is a data model?


Colleges Ccourse
Q5. Jois
Model Paper-l,
Q Student
Answer to give a shape to the data (or) to give a figure mode
mean of modeling aata 1.e.,
to the storeddata. A data
Data Model is a
understand the meaning of the data
to
by i1s igure and ensures that users understand,
Sphone Sage DOB
any physical implementation details
ture of the data without requiring Figure
which maintains the
infonmauo

data of every
user descriptive attribute,
relationship is a
The view of application areas
The "Jdate"
egardin attribute assoc with "Joins" GROUP
data across g the joining assoCiated SIA
The use of date of a udent.
SIA GROUP LOGO ENGINEERING STUDENTS
2on the TITLE cOVER before you buy N-ONE JOURNAL FOR
1.4
AYDERABAD Applications Introduc
Q DATABASE MANAGEMENT SYSTEMS (UNTU-HYDER patabase System ction to Database
Differentiate
between weak entity NIT-1 Des
Answer set and strong enti So above figure, FLIGHT is strong tity set and
Intheiquely identify its entities. Flight entity Departure a
i weak entity set. 1.5
has its own Since, eparture
Strong Entity Set arderto primary key which depends on
esented by a 'double line rectangle can identify
its entities FLIGHT
T.Ithas a primary key. Entity Setu
Weak ak entiy
ak
entity is underlined where as strong entity
uniquely
t has no primary key until the attributes of the strong entity set on which it den
ninator o ntity
discrimina with a dashed line.
A double line
is represented eit
by a single line rectangle.
he links weak entity set with strong entity set. Moreover diamond shape
The primary key
are included. ds that that
every veak
w entity (i.e., Departures) the double lines
is associated to some from
symbol isused
weak entity forthe relation
The relationship of tuples in weak entity set with the tuples in strong entity set
nindicateDeptr). strongentity (FLIGHTS) torelationship setis used
distinguishes all FLIGHT_ throughtherelationship
set
paritions the tuples. Then a set of attributes called discriminator distinguishes ein
Explaingeneralization, specialization and aggregation
tuples at2 in E-R Model.
Q10. Define the the partitionedtuples
Apswer:
terms: Relational Databases, Tables. (Model Paper-,
Q1(b) 1 May-19(R16),
Answer Ceneralizationn
01(b)
Relational Database Nov./Dec.-18(R16),
Generalization 1s a special case of specialization.
nete stottete00
ufe Q1
ecion approach may be top-dowm or bottom-up.
torm of d uatabase is considered as one of the conventional databaséthat consistof abundant inlormation. Data The In top-down, the entities
are identified and are subdivided.
the tables. Each table contains information is sto otom-up approacn, at unc ovwvc cnes are grouped to form a high Incontrast,
coun specthesthe different attributes ofan object about
and row
a particular object which is representcu rows and
(also
columns. Th
called tuple) specifies actual instance ot the object. The relatin ale. designer may first identify attributes of student, teacher
level entity.

teaaonal database refers to different tables in the database. is necessary that, every row
value i.e., individual tuple contain It ina tabie should consist
of uniow atity
nown
as generalization. The high-level entity is and then group common attributes
called super class and low-level into a higher
entity is called asubclass.
atomic value.
Relational Tables Employee
A table or relation can be
defined as the organized set of rows and columns. The rows are called
arecalled helds or attributes. It helps the programmer
tuples and the columns
simplifies the task of database in presenting data to the end user in an easy and eticient way
design. and als

ltis also called a relation since it represents a logical relation. A table contains collection of
it is also referred to as an entity entity occurrences and hence
set
Software Engg.
The characteristics of the relational table are as followS, CEO

Itis a two dimensional structure consisting ofrows andcolumns. Manager


Eachrow of the table represents a single occurrence ofthe entity set. Figure: Generalization
Eachcolumn of the table represents an attribute with aunique name. In the example, employee entity is a super class of software engineer, CEO, manager subclass entities. can also be said
Q11. How to represent the strong Entity It
set and Weak entity set in ER-Model? that attributes of employee entity have been inherited by software
engineer, CEO, manager entities and that software engineer
Answer ISAemployee.
April-18(R16), a1te)
Specialization
mun
Departure_time Anentity person can be defined with attributes name, street and city which can further be sbdivided into student and
Flight zacher. This subgrouping is known as specialization.
Arival time
ie ltis a process of identifying the subsets of an entity set each of which have different characteristicfeatures. In this process,
perclass is defined followed by the subclasses definition. After defining the superclass ofsubclasses,the attributesrelationshp
BsOciated with
these subclasses are defined.
FLIGHTS Strong entty C Street
Cey
Destination Source

PERSON
FLIGHT Deptr

Weak entity Departures


Date
Figure: Representation of Strong Entity and Weak Entity Student Teacher
Through E-R Diagram
Figure: Specialization GROUP
t oak for the SIA GROUP LOGO on the TITLE COUrn SIA
ace Sys
Database System Applications, Introduction to Database
TJNTU-HYDERAn
RABAD Design
MANAGEMENT SYSTEMS T-1
6Aggregation DATABASE
UNIT
1.7

set into another relationship


set. Consider th Student Studies Sehool
lt
is the concept which specifies the participation of one relatons ER
diagram given below showing relation
between STUDENI
****** Total participation

Same)Sad C-locatkon)
Afiinted
SD ranch Since C-name university
eegt Student Extra curricular
involves
activities
COLLEGE
STUDENT
Partial participation

edG Discuss the role of database security.


Admiss30n
Maintains Answer,
g
elrfne d et cp da mAprliMay-12, Set-3, 02a)
Views has the capability of providing only the necessary information to the users and hiding the remaining
data ie, the
system amd enhances the level
Dep-ao Dept-branc wk about
the data in the underlying relations. This will eventually simplifies the usage of the
so. For example, when a user
eit. Thus, when unauthorized users attempt to access the data, they are restricted in doing
information about the student, the DBA permits to view only the selected student information or fields
Figure: ER Diagram Involving Aggregation atemptsto access all the
without permitting access to the entire
student table.
ot the STUDENT.
Here, Maintains relationship is said to participate in Joins relationship as it maintains the joming details
as an entity set which define
dashed box around the Joins relation indicates aggregation. Now, the Joins relation can treated
be
heMaintains bo
the relationship set.
Q13. Construct an E-R diagram for a car-insurance company that has a set of customers, each of whom
owns

one or more cars. Each car has associated with ft zero to any number of record accidents.
May-13(R09),02
Answer
lace
ac
Vebye R Veb-lisenoe acc-date Complaint no

Jsvolved n Kccord of
BAY accdcntsy Accident

Figure: E-R Diagram

Q14. What is a super key? Give an example.


01(b)
Model Paper-4,
AnswerE
Super Key
ofacandidate key and a composile key i.e., super key is a set ofattributes or a single attrbu
A super key is a combinationrelation.
in a
that uniquely 1dentifies a tuple
Example
{Cid, Accno, Cname
Here, all the three attrbutes takcno particular record or a combination of any two attributes
one or te atribute canidentify a particular record.
identify a particular record or dny boy
example for total participation and partial participation.
Q15. Give an
May-15(R13), a10
Answer of school students. All the
the students
sts will study in the school exta
Consider an example but only few of them participa
GROUP
curricularactivities. SIA
ahase System
Databa Applications, t Database Design
Introduction
IJNTU-HYDEP
HYDERABAD UNTE atSupermarke rket 1.9
SYSTEMS
MANAGEMENT shopping
places the bar code ofa
8 DATABASE product against a bar code
sier reader. The application program uses the bar
The castd reduces the number of items on the database. codetoidentify
price
PART-B the
user can en call the sis
also supermarket to know the availability of
the product. The telecaller accesses
sOLUTIONS The product is available or not.
The the database to know
ESSAY QUESTIONS WITH Telecommunications
APPLICATIONS
1DATABASE SYSTEM il Database 1s usedta to store the det
details of number of calls made to generate
the bill. For prepaid customers, it stores
thecredit
Versus a D5WS
istorical Perspective, File Systems available.
Q17. Write a note on DBMS. Explain database system applic
ein advantages of database approach.
April-11, Set-2, a18 OR
Q3(a
advantages of DBMS over fle oriented system.
Explain the

Answer
Define DBMS. List database system applications.

Database Management System (DBMS)


OR

erefah feplerary ee
,
Model Paper-i,
Q2/)
Q2(a)
Answer
Avgntages of
The
Database Approaches
following are the advantages of DBMS,
d
tsgnurl

Dalabase management system is a software that performs the following unctions, Program data independence
Define a database Reduced data redundancy sh
ved data consisteneyndetob
mont
Generate reports
mproved data sharing
t ct
pt Create data entry screens. 4.

DBMS basically consists of set of interrelated data and set of


programs for accessing those data. Ihe primary objective of
5. Enforcement of standards n cereai
or database information
System is to provide an efficient environment that makes the retrieval and storage
a
easier
s anagement
6 Improved quality.
iq te adl

Applications of DBMSs
Program Data Independence dis
description) from aplication
ome of the applications of The program data independence can be defined as a separation of metadata (ie., data
Database management systems are used by many individuals either directly or indirectly. a
ograms using the data. The database approach strongly provides access to data description by storing it at central location
DBMS are listed below. are independent storage details the modification of organization's data
called repository. As database programs in database of the
) Transactions in Bank programs.
becomeseasy and can be enhanced without periorming any change to the application
The user accesses the bank database for crediting or debiting the account. The bank database stores the details of individual
Reduced Data Redundancy
customers, their account, loans etc. avoiding of duplicate data and
Redundancy can be defined as duplication of data. Reduced redundancy specifies the
i) Reserved Ticket Reservation separated data files are integrated
reducing the total amount of storage space required. In an ideal database design, all previously
Database of airlines is used to schedule information and to reserve the ticket. nto a single logical structure. This implies that the data gets stored only at one location within
the database. This minimizes the
Suppose, if two travelling agents compete for a last seat at the same time, the database should accept only one request and extra processing time to search the required data in a large mass of data. Moreover, it also helps
in eliminating the inconsistencies
inform the other that his request cannot be accepted. insearching the exact data file required.
programmers to control
i) Students at Universities However, the database approach does not completely removes the redundancy but it entitles the
Universities have database of various courses they offer and a database for the faculty and students. Each student record redundancy.
contains the name ofthe student, marks scored etc. Each faculty record contains the name of faculty, his employee id.
salary, subjects dealing with etc. 3Improved Data Consistency 1
data between applications and other
iv) Internet Interactions defined as validity, accuracy, usability and integrity of
Datla consistency can be are made to
data to the user. However, in case of inconsistent data, changes that
Internet applications are mainly database driven. For example to send an e-card to a friend, user first interact with the SThereby, providing a consistent provides incorrect and contradictory information to the
sers. But
data are not reflected to other data. Such databases
database based on the purpose of the e-card. If the user want to send a birthday card, he selects its from categories and nt
redundancy is controlled or minimized, the likelihood of inconsistent data also
is minimized.
retrieve various cards from the database.
Online shopping is another example, for this, the user select an item from the database and then sends his credit card 4ImprovedData Sharing
user requres i1s one
number with some additional information to buy the product. internal and external users. Here each
Saring
or more
summarizes database access to both authorized representation of some part of database whicho
i5
u be defined as a logical
Computer Horoscope e wS Into the database. A user view can report required by user
is done by recognizing a form or a
(V) Suallv
task. The creation of user view
This type of application require tne user to enter nane, date of birth, likes and dislikes in a form. details arc
All these
daily basie uer to pertorm the entitled to share the data in the database
nared against a database to search 1or a pertect match and his future prediction. this, existing application programs are
to
dddtion
Enforcement
(vi) Database in a Library' of Standards
administration should establish and
enforce
stores details of the books available. Theuser accesses this database to find the role of the database
tne implementation of database approach, done through data repository that providesa powerful set tool
eahase of
1Dis da anagement by allowing a user to reservea book and intimate a book quickly. The databa database sta standards is accessing, updang
allows casy ds him through a mail,
a reminder to customers who did not return the book is availa
when the book the DBA Trs The development of these standards, uniform procedures for
data quality
by due date. This
system uses a bar coac reader andprotecting adards involves naming conventions,
to database.
toprovide access SPECTRUM
data,
SIA GROUP
Look for the
SlA GROUP LOGO on the TITLE COVER ALLAN
LL-iN-ONE JOURNAL FOR ENGINEERING
STUDENTS
before you buy
System Applications,
seSy
aase introduction to Databa
SYSTEMS
1JNTU-HYDERA
RABAD
1.11
MANAGEMENT UN anfages
DATABASE vant
to be
required to n
1.10 dlata 1ss
required be stored conSequemolockS memory. For example, student marks record were required
Of

. mproved Quality fdata


ualiynrove
majorly arccts ne strategic plan
Related
Keetored
De
very
opcx
t to the student details record. This provide efhcient original query responses but tails
qucries.
to provide
for new
he a
or data 1s atmost important in database approuct.database so as to en
cannot oe
improve u
Violated by the.iolated
by databuse useny
htions
reorganizaionn ls
ume consumin
and database The tools and processes provided by
administration. a nule and Data
benaves as
ntegrityconstraints are applied by DBMS. strains De programmed.
has to be
Tnes query haS
with such constraints the users maintain the improved
ity of data.
Stored
SuchCReaning8
cle couse. Evep
operational data betore )
The data warehouse environment role is to clean the the op
2 quality of data iin data warehoUSC
data to ayo data were not in practice until 1960s and 1970s. With the development of system R, the implementationof
maintan the quality
the ot ,01a
improved drastically. system R, an IBN
15 an
K, is l5M research product based on SEQUEL2. If provides a mechanism to
Q19. Compare the database system with file system Reihse
dat relational model.
eiatoal or
idatefeasiony
ON
m. N/DS. IBM DB2, Oracle, Ingres, DEC Rdb are some earlier relational database system.
walke & comparison between database system and Tne y Apnm, Set-1, Q1
QL
Answer
Database ManagementSystem Advantages
File Processing Systemm or telated nles that are 1mplementations.
Database is a collecctiongroups.
File 1s a memory block of a secondary storgc arranged into different
0 Easy from 1Ow ievel implementation details.
Programmer relieved
device
ke aisk, magnenc tape that iogIcay
coaed in procedural fashion.
Stores related pemanenuy.
records reiations 1.C., table. ueries need not be
Data i5 accessed using (n) logical level.
2. Data in accessed via singie or multiple hies. 1s used to store the Programmers wok only at
Database administrator v)
Fike manager is used to store all relationships structural table.
relationship in form of
in directories. secure since it restric 1990s
in earily 19905. This is designed for query intensive
applications. In 1980s the focus was on
Data in database are highly sQL language was developed
Data in file system i1S insecure since 1t ralis to
however the TOcus was shitted on decision support systems in 1990s.
Object relational model was at
unautnorZcu aeeess application
restricts unauthorized access. can oe pertormed. date intensive
Data recovery and baCKup initial stage.
Data recovery and backup cannot be performed. removed in DBMS.
the
Kesource Planning (ERP) and Management Resource Planning (MRP)
6. Data redundancy 1SSue is Furthermore, due to the development ot Enterprise featured
Data redundancy issue exists in file system.
7. It is possible to represent complex
relationships
packages, an additional 1ayer or appncaon0rientcd
teatures is designed on top of DBMS. These application-oriented common
It is not possible to represent complex soft, Bean and Siebel. These packages typically determine
among data. nackages are nothing but systems from SAP, Oracle, People are generally used
elauonsnips amongE data. Financial Management and Inventory Management which
provides storage structure tor efhcient
query functionalities like Human Resource Management, and the data gets stored in DEBMS.
It does not provide any sort of storage 8.t processing by most of the organi1zations. Subsequently,
it becomes cost etfective for the organizations
hich reduces the burden and cost ot developing
structure tor ethcient query processing
Here, the layer can be modined according
to the organizational requirements which
provides effhcient utilization or resources.
t does not provide efficient utilization of 9.t the layerfrom beginnin8
later the data was stored in
resources.
users In first generation computers, the data on
websites was stored in the operating system files then, responses
10. DBA resources the coniict among nmulgple respectve are generated
10. File manager fails to resource the conflicts browser. The user-requests are tetched and their
while accessing same data. the DBMS and accessed by users through web
among Various user while accessing the
uSing HIML then they are displayed on the screen.
data, live
are getting advanced and it includes visual effects multimedia, streaming
this generation, DEBMS functions
In
Write a brief note on history of database systems. maps and iSRO's carth observation system project.
Q20. ucos, digital libraries, scientiñc projects, google
Model Paper-4, 020)
in a DBMs
Answer
A f history of database management systems is as follows, 1.1.2 The Data Model, Levels of Abstraction
instances and schemas.
1950s What is view of data? Explain briefly about data abstraction,
tapes. All the data was storeu
Evolution of database managerment system began in late 19>0s with the invent magnetic
of
OR
more tapes and writing to a new tape after processing. Input devic
on tapes. Processing of data requires readng aaarom one Or
process could be better understood with an exampie
were not yet invented and punched carOs were used 1or enictng the data. 1he
were punc Explain the following,
Suppose certain grace marks were to be added to the students depending on varied factors. The grace marks
and it 1s added to grace marks in punched card. 1ne
on cards in an sequential oraer. 1ne diata iron lapes new tape. omunancousiy
is read.
1s again stored back intoa
0 View of data
result of the processing
() Data abstractionn
Disadvantages
Data must be read sequentially. Instances and schemas. May-17(R151, Q410)
to data.
() Main memory 1s not sufhcient load Answer :
was avallaoic and hence the setup time is high.
(iti) No operating system a)
required. View of Data
iv) Implicit scheduling was require complete data, s0 the respotsiy
Database is data. A user will not always record ot a s
1960s-1970s COllection of large volumes of user who wishes to see the
system could enhance its features with invent of hard disk
ne database
that is required to the user. A lealures o
Database nagement
data,
102 ma
1o provide only the programmer who wishes to enhance the
1

Similarly, a vicw ou
orts random access of fnles. This feature were used to develop network atabase with all student details. different users nced ditterent
Unlike files, and hierarchicau o stem is no provided to know how is data stored. Hence,

cLook for the SIA GROUP LOGo on the TuLE COVER 2 before you buy
nea about the data, but
neced

ENGINEERING STUDENTS
SIA
GROUP

RL-IN-ONE JOURNAL FOR


Applicatior
atabase System
Database Introduction
to Database Design
1.12 SYSTEMS TJNTU-HYDERA IT-1
DATABASsE MANAGEMENT ABAD InternalPhysical Level
abstraction is the internal
1.13
(b) Data Abstraction 1owestle of
.
level or physical
ally stored. The level or physical
In DBMS, the data can
be abstracted n three levels (or) in
in other words there
1n ou
are three levels
or abstraction in DBMS.
D wthe da malschema explains theInternalvarious
Schema is written schema or internal
using yet another schema,which
Data Definition Language, explains
ed
OL. The ceauence the stored types of stored records,
The goal of the three request and tne pnysical storage of. dat what indexes exist, how the internal
level abstraction inin a DBMS is to separate ythe user's a plan that expla:in records are in, and so on. stored
database. The data abstracted separdtc means plains Ahe Thus, at the Internal schema/physicalfields are represented
at each of On described by a word scheme.
A scheme w data structures are used.
el
records and relationships ese is a
these levels IS
existing between them, at each level. scheme, means a systematic plan fora
lly the word sche
Basically
level, very complex
some objective, is Schemas
used in the database literature with the word chema". Jastances and
The three levels of abstraction u (0 never Some
information is inserted or deleted,
there will be some change
are, which is. stored in the database in the database. An instance
) ollection of information at a particular moment, ofthe database
External/view level
t te itet ot w01a,tegeins col databas whereas database schema
(1) Conceptual/logical
Onceptual/logical levei t sthe
designof
the base. is the overall
level
(ii) Internal/physical level. The
ase schemas and instances can
dachema corresponds
be better understood by analogy
to the variable declarations thee to a program written ina programming
languag
91 L2 e. dataualar
He
a in program. Every variable
particular time, the values of a variable in a program corresponds to an
1age.
has a certain value at given
a
Extemal Schema 1 External Schema 2 Extermal Scheima 3
Extermal level instant. Ata instance of a database schema.
(OR) OR
According to ANSI/SPARC architecture there is schema for each level of abstraction.
(OR)
View Vrew B View 'C
View evetieuse nhatsglineend
prog nal schema provides a definition for external view of data written
th DBA in external DDL. The conceptual schema
consulao 1neition for conceptual view of data. This definition should be independent
of physical storage and access methods
Conceptual View Canceptunl level t Sboa d ge orovidear data independency. As the external view is derived from
to provin
conceptual view, the data independence at conceptual view
(OR)
anirarsaas the external view. The conceptual view 1s Written in conceptual DDL. The internal view designed by
LogcalVirw
(O willrenten in internal DDL. It defines how data is stored, its indexes,the sequence of data etc. is internal
LogicalLeve
1, Detined oy

02 Exolain the difference between Logical and Physical data independence.


Physical Schema
(OR)
nemal
levelKes tqlvot peieoaF r
infiernal ew
(OR
Physical level
Defimes,
90 Answer
Pysical View how d Logical Data Independence Physical Data Independence
Itishigh-level of dataindependence It is low-level of data independence.

Di Itis related to conceptual schema where in It is related to external schema where in actual
different logical views of data are provided to data storage activities are performed.
a
igure: The Three Levels of Abstraction/Architecture of
DBMS
tt different users.
The changes are made to the conceptual The changes are made to external schema without
ExternalView Level affecting the conceptual schema.
schema without affecting the external schema.
The highest level of abstraction is the external level or view level or external schema, where only those portions of the
database are displayed, which are requested by the user, but not the entire database. Any given database has exactly one Modification are done on data structures such Modification's are done on storage structure such
conceptual schema and one physical schema, but it can have more than one extemal schemas, each connected with a group as entities, attributes, relationships. as storage devices, indexes, switching.
of users. It provides data optimization and data reorganization.
in the database. It can
Itprovides data integrity and data effeetiveness.
The external schema has a permission to define the records and relationships, that can be stored It defines relationships using complex low-level
retrieve the records from the database. it also contains the method of retrieving the records in the external schema from Itdefines relationships among data by using
simple structures. data structure.
the conceptual schema. The retrieved records contain everything, ie, entities, atributes and relationships.
Application programmer must maintain the Application programmer need not maintain the
The external schema actually guides the user requirements. For example, the stiudents are allowed to find out the names information about physical organization.
information about logical organization.
of faculty members teaching courses as well as course enrolment.,e eltn to
The implementation details are transparent the
This can be done by defining the following view, The implementation details are not visible to
users.
Course (cid : String, fname: String, enrolment: integer). Therefore, A user can treat a view just like a relation and
ask the users.
It is easy to maintain
questions (queries) about the récords in the view. It is difficult to maintain.
) Conceptual/Logical Level 023. What is a data model? Explain ER data model.
The next higher level ofabstraction is the conceptual level or logical level or conceptual schema where the entire information (Model Paper-4, Q2(b) |
April-11, Set-2, a31b))

of the database is displayed. This level is used by Database Administrators (DBA), who decide what information is to to
be Answer:
stored in the database. Any given database has exactly one conceptual schema connected with both external schema, Data Model
display the information of the user's request and intermal schema, to store the information in the database. A dala mo
(or) to give a figure to the stored data.
to Language is a mean of modelling data i.e., to give a shape to the data
The conceptual schema is used by DBA only write the information in the database' using Data Definition makes del nderstand figure and ensures that the
users understand,
(DDL). If physical data independence 1e., (hide irom physical details, how data is stored) is to be achieved, then hose the meaning of the data by its
pDL definitions must not involve any considerations of physical representation or access technique at all then, they physical implementation details
ne nature of the data without requiring any
content oniy nus, there must be no reference in the conceptual schema to store ne
mustt be definition of informationsequence, indexes, hashing schemes, pointers or any other storage The view of data from other user's perspective
ntation, stored record onerS and access details. This
methods of driving the reeorde
conceptual schema also contains attributes and relationshin
the Internal Schema. These
aIrom The use of data across application areas GROUP
retrieved records contains everyting 1.e, entities, SIA
ENGINEERING STUDENTs
EIA GROUP L0co hTIT AL-IN-ONE JOURNAL FOR
System Applications,
MANAGEMENT SYSTEMS
(JNTU-HVDERABAD ailT-1 Database troduction to Database
1.14 UNI Semantic Data Model
DATABASE The
1.15
Types of Data Model data model is a more
4 semar high-level data model
anADBMS
enterprise, These models that makes it easier
1he data models are
(a)
divided into three different groups, which
are as follows, o u
scenarid cannot
contain a wide variety
of
na DBMS. widelysupport all these relations directly, so it 1srelations
for a user to give starting
that helps to describe a description
reaf application
Object-based logical models model A used semantic data model built only with
is the Entity-Relationship few relations known as relational
(6) Record-based logical models phically denote entities and relationship between them. (ER) data model which
allows us to
(c) Physical data models.
iv) The Functional Data Model
(a) Object-based Logical Models actional odatà model makes it easier to
. DBA, The functional defñne functions and
view-level. LOgical level is used by call them during data processing
ne Object-based logical models are used in describing data at logical-level and must exist ame 0 ecord-based Logical Modelst
Bog
as to makea decision regarding what data are to be stored in the database and what relationsnips databacthose (b)
is to be viewed by the database user ced logical model describes data at logical and view
data. On the other hand, view level describes only part of the entire database that ie levels. It stores
t hides the details of the informmation veral types. Each record nas 1xed number of (helds or) attributes and eachthefield
of
data in the form ofrecords (documents)
contains fixed length.
stored.
narison to object-based data model, the record-based logical model describes
en ypes of object-based logical models include, e 2
database with higher-level implementation
the overalllogical structure the
of
(i) The entity-relationship model
(i) The object-oriented model
rd-based models are of three types,y
te

in)
() Relational model
a The semantic data model
at (iv) The functional data model. 9touinb i) Network model
)The Entity-Relationship Model (ii) Hierarchical model. ss brt
Entity-Relationship Model (E-R Model) is h () Relational Model
ctiy 1s a real-world object that can be uniquely identified. The
oD a collection of basic objects called entities and the relationship among these objecIs, Basically, diagram
is The relational model represents both data (entities) and relationships among data in the form of tables. Each table
the graphical representation of the entire logical structure of database. has multiple columns witha unique name. Consider the following relational model.
Symbols Used in E-R Model Example
Rectangle represents entities Customer Relation
Diamond represents relationship among entities b lial-lgida Customer-name Street City Ace. No.
Elipse represents attributes (characteristics of entities) Hameed Musheerabad Hyderabad 7888
Lines represent link of atrzjbutes to entities to relationships. t huraftie Rahmat Khairatabad Hyderabad 1500
lConsider the following E-R diagram, Fazal Abids Hyderabad 2523

Customer-name
AccountRelation
Acc. No. Balance
Customer-number Customer-city Account-numberD Balance 7888 70000
1500 45000
Customer Depositor Account oi 2523 25000
can
Lhe description of data in terms of tables is called relations. From
the above Customer and Account relations, it
are maintained
Figure: E-R Model De interred that Customer details are maintained in Customer
relation database and their deposit details
in Account relation database.
The above E-R diagram consists of two entities (customerand account) and one relationship (depositor). The deposit
relationship specifies the assocation between customer and account, When customer opens account, the custo i) Network Model
among data are represeniteu oy
should specity the attribules Customername, Customer_number, Customer city and records and relationships
Account should speciy Network model represent data in the form of collection of
attributes, Account-Dumber and Balance.
t links. The links can be viewed as pointers g
te

(i) The Object-oriented Model Example


Like the E-R model, the objec-oriented model is based on a collection of objects, An 7888 70000
object contains values s Hameed Musheerabad Hyderabad
le in instance variables, methods (bodies of code) that operates on the object.
Objects containing Similar types or values and similar methods are combined 1500 45000
way in which one object can access the data another
to form classes, A class defines obj Rahmat Khairatabad Hyderabad
of object is by invoking a method objec
ction is called sending amessage to tne object. Thus, the call of that
externally visible. The internal part interface of the methods of objectouesth 25000
ofthe object, the instance variables an dcible Abids Hyderabad 2523

externally. The result is two Jevels of abstraction. and method code are
GROUP
SIA
ot the SlA GROUP LOGO
2 on the TITLE COVER
before you buy
ECTRUM ALL-IN-ONE JOURNAL
FOR
ENGINEERING STuDENTS
MANAGEMENT SYSTEMS (JNTU YDERABAn Applications.
1.16 Database system Introduction
DATABASE f.1 Database Design
(iii) Hierarchical nposite Attributes
Model Q26. What 1.17
hierarchfcal model represented ass collectio
is
which can be further divided into smaller lication programs?
Hierarchical model is same as thé networK data inthe Anattribute base access for Explain
The links can be iewed as pointers But, components are called composite attributes. plication programs. data-
O records and relationship among
data and are col
nected by linkSein the database are represented in the the
difterence between these two models is that in netw el the records in un form wample, the attribute name can further be divide Answer
ted in the form ou trees or
of graphs, whereas
in hierarchal model, they are represented rst name, middle name and last name.
Similarly, Database Access for
Application Programs
attribute address can further, be divided into
Custome Application programs
number, City, street, country. a user to interact
are the
softwarecodes that enable
with the database. The
KhairatabadHydembad Single-valued Attributes access the database in application programs
Hameed Musheerabad Hyderabad Rahmat two ways,
Certa attributes take only a single value in all instances. ) Byusing application
age oI a person is a single-valued programming interface
1500 45000 For example, the
7888 70000 ii) By extending the host language
attribute as man cannot have two age. syntax.
Differences between the Models Multi-valued Attributes Several application development
environments, provide
iv) platform
models. i.e., from the fact that it does not
fact that not use pointers for developing applications
Attributes that can have more than one value at a time and include facilities
links. Instead dters from the network and hierarchical or that enable GUI designing and other
inks. Instead, it associates records by the values it holds for an instance are called multi-valued attributes. For quality of the software. Some
features that enhance the
(c) Physical Data Models the color of the product. A product might be of the application development
environments are Sybase, JBuilder.
hysical data models give the description of data at the lowest level. It describes about the storage ot data in low-leve multicolored in this case it takes more than one valu at
data structures. a time. () Application Programming Interface (API)
Two types of physical data models are,
Unifying model ()Stored and Derived Attributes Application Programming Interface is set
a ofprocedures
Some attributes need not be stored, but can be derived that sends the DML and DDL to database
statements and
Frame-memory model. retrieves the results after processing from the database.
from available other attributes.
Q24. Give an overview of
ER model. The commonly used API inchude ODBC (Open DataBase
For example, the total number ot students in a class
Answer: canConnectivity),
ER Model becalculated by counting the number of student records APIs provides and JDBC (Java Database Connectivity).These
Similarly, the age of a student can be calculated, by an interface for application programs written in
For answer refer Unit-1, Q23, Topic: The Entity-Relationship Model. subtracting the date-of-birth field from present date. Java respectively
Entities
Theand
age field is called derived attribute and date-of-birth is
main)
An entity is a real-world object that can be uniquely identified. There are two types of entities. called stored attribute.
)Strong entity 025. Write a note on speciality database.
i) Weak entity. OR
) Strong Entity ----
What are speciality databases ? Explain.
Strong entity is the one that does not depend on other entities. Application Application Database
Answer: April-18(R16), Q3(b)
For example, a chairman of a company does not depend on anyone for final decisions. Program Programming
Hence, chairman is strong entity. Intertace
Weak Entity A speciality database can be defined as an electronic
repository which is located in a computer's RAM for storing Figure: Application Programs Accessing the Database Through
Weak entity is the one that depends on other entities for existence
specialty related data and met adata. This type of databases Application Programming Interface
For example, if an employee is retired then we do not need to store the details
(children) entity is weak entity. of his dependents. Hence, the dependens e used to perform operations data search, data.retrieval,
(i) Extending Host Language Syntax
data manipulation and data calculation. Inorder to overcome
Relationships Database can also be accessed by extending host
restrictions possessed by relational data model, database
Relationship is an association among various entities. The entities that cevelopers have developed multiple data models. Object based language syntax so as to embed DML statemenis wrthn the
take part in a relationship
are called "participants
and the number of participants of a given relationship are called "degree" of relationship.
If every instance of an entity participates in at least one instance
of a relationship, then the
a model and semi-structured data model are the two data
models based on specialty
database
host programming language. SQL(Structured Query Languago
which is a database sub-language is embedded in a
programmmg
else, it is said to be partial participation. participation is said to be tou
A relationship can be one-t0-one, one-to-many or many-to-many.
0 Object Based Data Model tyb language
For example,
Attribute For
Model.
answer refer Unit-I, Q23, Topic: The Object-oriented

Each entity and relationship has a property called attributes. These attributes COBOL stat
Simple Attributes
can be.
e, Semi-structured Data Model -- **

attributes are also called as atomic atuributes wnicn cannot emi-structured data models allow data specification
be subdivided further.
roll number and class of "student' entity cannot be further subdivided dturther. For example, the attribu
attributes ie neretes.each data item of similar type contain different set
An Extensible is (XML) widely
EXEC SQL
Markup Language
Look for the SIA GROUP LOGO
2 on the TITLE COVER represent semi-structured data. SELECT
before you buy PE
RUM ALL-IN-ONEJOURNAL FOR ENGINEERING STUDENTS
SIAGROUP
18 JNTU-HYDERAPA. UNIT- to Database Design
DATABASE MANAGEMENT SYSTEMS BAD)
Thefollowing are the different data structures used by storage
FROM emp manager. 1.19
The main task of database
system 1s to provide the (a) Data Files
3 r
WHERE
e
emp name="Vivek Verma
with simplified view of data.
This 1s achieved by hidi
physical level implementation details
from the user, the he Thes are the hles that contain the database.
view. But, for faster proceeT
is Dictionary
provided with only high-level (b) Data
END-EXEC
operations need to be done at physical level.
The queries at loe aintains meta data regarding the
diferent data structures used
level into optimal sequence of operations at physical level5a in database.
---- (C)Indices
Storage Management e
It provides 1ast access to the required data items.
The execution of these Storage management iS handled by
storage manager t
SQL embedded statements acts as an interface hers
Processor
different from the normal
SQL precompiler is used co
isbasically
execution. A special compiler called
Special
basically a prograi module. Ihis module
aprogram
atohase progTa
2Query
Ompiler to compile low-level data stored in database and the application programs. reter of Data Definition Language Statements
the source code.
oDt statements written by DBA to define the schema are
1.1-3 Data Independence, Application Programs interpreted
and stored in the data dictionary,
Structure of a Compiler of Data Manipulation Language Statements
DBMS
Q27. Identify the
main components 3uby11) Asany other compiler, DML compiler converts the DML statements in low-level
pertorm query optimization" instructions.It also optimizes query
briefly explain what they do. in a DBMS and i.e, the
Storage management Query Evaluation
Apri/May-12, Set-1, 01(b)
DML compiler converts DML Statements into low level
OR instrüctions which are evaluated by query evaluation
machine
What are the main components in a DBMS and Users
briefly explain what they do? Naive Application Sophisticatedd
Answer: May-17R(15), 02(a)
Database
Luser 70gra mmer users DBAA
User Inter face
Generally the user interacts with the
management system through an interface. The DBMSdatabase Figure: Storage Management
eA bainterface Progmms Tools Tools
does the
processing and retrieves the data from the database. Data is stored in disk using file system provided by
operating system. The storage manager provides interaction
Database system is divided into two modules, with file manager and converts the complex DML statements Comiler) ML
POBta CompilerQueries DDL
interpretet
1. Storage management into low-level file system commands. In addition to this, storage
he manager is responsible for storing, retrieving and modifying data
Query processing. within the database. Storage manager consists of the following
key components, DM
ompi iler
User ) Transaction managernp
i1) File manager
tan s 2 Query
Evaluat1OD
Ce (ii) Buffer manager Query Processing

() Integrity manager o
(V) Authorization manager.
;
Query Processar Transaction Manager didi 2 MaeenManauemend Authorizat ionTransaction
DBMS It manages the transactions so as to ensure that data remain
in consistent state even after the system failures. It also torage Manageme nt
Storage Manager
enables the execution of concurrent transactions without
any confiicts.
(ii) File Manager
It manages the process Data fles Indices Data dictionary
of allocating disk and data meta data
Structures that are used for representing the
informatio Data Stor age Struc ture
Database saved on disk.
(ii) Buffer Manager DATA
It handles the transfer
of data from disk onto the maim igure
Figure: Database System Structure memory and decides
what data must be kept ma
memory in wnat is data independence? Explain the two levels of data independence.
Model Paper-l, Q2(b)
Data stored in database may costs more than trillion (iv) Integrity Manager
Answer
bytes of data. Main memory cannot accommodate for such It verifies whether the
Data Independence
is stored in disk. But for
large amount of data, hence the data the data are satisfied.
integrity constraints deineuon
definition in the next higher level
known as u
from disk to the main definition in one level without altering a schema
processing data needs to be transferred independyng a schema abstract data types n moderm
pae
similar in many aspects to the concept of
consumes processor time, hence the (V) Authorization Manager
memory. But this transfer C COncept of data independence is concentrate on the general structure,
ra
such that the data transfer rate is not It checks the authority details from the users, allows them to
data needs to be arranged
high. This is taken care by storage
manager. authorized users to of users and allow only
access the data.
0n low-level
1Ow-level s.
Both implementation
implementation detalS.
too
SPEC SIA GROUP
Look for the SIA GROUP LOGO on the TTLE COVER STUDENTS
2 before you buy HLLIN-ONE JOURNAL FOR ENGINEERING
(JNTU-HYN
HYDERABAD) System Applications, Introduction to
SYSTEMS base Database
MANAGEMENT Design
1.20 DATABASE N Architecture of DBMS S Shown in the below t
Unsophisticatea o 1.21
Levels of Data
Independence A s, taveagenis el)Sophisticated users, application
aprogram
nere are two levels Web Forms Application Front
of data independence. 1 he re, Ends sQL tnerface
Physical Data Independence
grams is known as puysal data inder dependence
Changing the physical schema without applicatron pa wherein actua a Sorage activi
causing a change in
thout causinE ternal schema Sho Command Dow
low-le
Sically, Cvel
petotmed.
a of data independence and is relaiu
Modification are done on stora e
ae devices, indexes, S : 1s neces
cessary
to
Petom modification at physical level o as to enna nerfomance e SQLCommands
palrt irom this, talsoprovides
it
data Structre.
ysical sng cormplex low-ievel
ndependence defines the relationships using
plzaton reoreaniz
()
data
and data reorgamizaton.

Logical Data Independence data inndependen


programs 1S Known as logical
the conoeptual schema without causing a change in application
nging snga internal schema in order to retriev
providea
chas c
means to go back irom tne
tous Pportions of the database separately bascu
cy
schema to the
on the user s requirement
based ou
1he nou elogical level
ered. For exampie, independence, level system
C
e (PlanExecutor
Pn hows interaction

De Petormed whenever the logical structure of the data


physical data of logieatbe
modihed when changes are made to
pndcnce is more difhcult
market accouns
because the centralized control o
entralized of the database Is heavily depend.
on
a :Operator Evaluator Optimizer) Query Evaluation
ndependence, Engine

ctuine ol the database so as to store (Cea


CES.
wnte short notes on transaction managemen
Answer:
ransaction Lock
Iransaction Management manager
Managr
are pertormed by DBMS. Transactio
senies of actions such as read, write, abort and commit, which action
even arter the execution of the
cn
s.
reters to managing the transactions such that the data remain in consistent State
1t also provades optimal concurrent execution of the urdisde
he

Log

During the execution of transactionis, if some changes are made to the database then a failure tmay occu which is refered es and Ac
gedo ery
to as system crash'. Inorder to avoid this failure, the changes made to the database must be stored n ne tom or records by Man
sing a database structure called Log. These records contain the information about all the update activies. ow, o ensure that
une stored nlormation is available at the time of recovery from a system crash, a principle called write-ahead logging nced to be
ensuired. Bulter Manager

.ACcording to this principle the information regarding any sort of changes made to the database object must initially be
recorded in the log record. These log records are maintained asa sequential file and the write operations performedf on these
nececear to
records are sequential writes. But, prior to storing the information ahout the chanoes into the disk t is DiskSpace
and cvery log record including the record whose LSN is equal to the page LSN must be stored in the stable storage. Manage
DBMS
when the database is recovered from a system crash, huge amount of time is consumed. Thus, to reduce the time on -
on ciied check point is implemented. Check point refers to a synchronization point that indicates the amount of search
thatis to be made jn the log so as to bring the database back to the consistent state.
Sbows references

Q30. Explain the Database system structure. (Model Paper-ll, Q3(a)| Nov/Dec. -18(R16), Oz(a))
OR
GIve an overview of database architecture. Index files
System catalog
Database
Answer April-18(R16), 02 Data files
Structure of a DBMSs
A typical DBMS structure is based on relational model receives the SQL commands Figure: Structure of DBMS
developed from the diflerent user
interface. It designs plans corresponding to query evaluaton, anaiyses them and implements this layer, te
them on the database subsequentuy makes use of the relational operators. In
once these tasks are completed, it generates responses. e and access method layer, codes are placed which pages are also supporied. tnis yd
les ar files, indexed files and
nta icd, data 1S stored, records are collected, heap
Each time a query 1s generated by user, he parsca query is given as input to the query
optimizer. Now the query optimi maintains
e records of the files and streamlines the inlormabon in a ni
designs an efficient plan tor evaluating nc query oy deploying e ntormation with
respect to the data stored. manager exists. It can be said that hie and access nie
On the other hand execution plan can be detine as a bluceprint tor evaluating queries. It is ne hle and access method layer, the buffer
t manager. Its main role is
to transfer pages from disk to
main memory and decide
what amount of dala
present whose role is to manage the disk
Sp
erators. n relative lo this, the relational operatos 10ms as the basis for the query represented in a form of a rec must be ken space manager is
evaluation engine codes tor u storage an deallocating, reading
ang,
memory. Below this layer, the disk
and writing into the pages of the higher
layers.
Look for the SlA GROUP LOGO I2 on the TITLE COVER SPECTRU
SIA GROUP
before you buy te N AL-IN-ONE JOURNAL FOR ENGINEERING
STUDENTS
Database.system PPcduons, Introdu too
IJNTU-HYDERA T-1 atabase Design
1.22 SYSTEMS RABADI
yDATABASE MANAGEMENT Cad Users 309/data 2apiut
1.23
modifications so is too suppo
The DBMS handles the requests records of database the clients of database who access the database for various reasons.
are lients
of the users Systematically and keeps the recovery also co End users Based on the level of awareness
Concurrency and crash recovery. Also, concurrency control and omprises e.end-users can be classified into three types. of the
components of DBMS corresponding to
OL ransaction manager, lock manager manager is to assure that the requece
uest and
and recovery manager. The role of the transaction manager
releasing of locks is carried out according
to the lockingprotocol. On the other
hand, lock keeps the records for trackin End users
the requests made for locks. Also, it
grants locks on database objects
Kecovery manager component in DBMS deals with managing the records and restoring tne data irom the system after
afo. a
Naive users Specialized users
crash. Sophisticated user

DBMS must interact other components such as buffer manager, disk space manager, file and access method layers. Figure: Classification of End User

Q81. Explain the different roles of programmers and end users of a data Naive Users
database administrators, application )
base. Who needs to know most about data
base systems? Sophisticated Userstese,ijitan eu ol (ioztefop
Answer Specialized Users.
(ii)
Database Users and Administrators Q32, Topies: Naive Users, Sophisticated Users, Specialized Users.
or remaining answer refer Unit-l,
There are four types of users of database. Application Developers (Programmers) tetuiotee 3litgee ouass u
ec stilh
(a) Database administrators For answer refer Unit-l, 932, Topic: Application Programmers
(b) Designers of database 032 Explain the database users and user interfaces. April-11, Set-3, 04(a)

(c) End users ORsi Snutsiiiroah at


(d) System analysts/Application developers (Programmers). List various categories of database users and discuss their interfaces to DBMS.
In a single-user DBMS, a person himself defines and manipulates queries. But for multiple-user DBMS, a single person May-15[R13), a2ta)
Answer
can not manage all tasks.
There are four types of database users and they use different user interfaces. They are sophisticated, specialized users
(a) Database Administrator application programmers and naive users.

As the database is being used among multiple users, there should have some control over the data and programs that provide .Sophisticated Users
access to data.
Sophisticated users are the users who interact with database systa without writing programs. They use certain queries to
DataBase Administrator (DBA) is the one who provides control over the data and program designed to make data accessible. retrieve the data. These queries are submitted to a query processor who evaluates the query and process it.
(b) Designers of Database Specialized Users
Database designers of such
pecialized users are sophisticated users who use specialized database applications
written by themselves, Example
systems, computer-aided design
applications include knowledge-based systems, expert systems, environment-modeling
Physical database Logical database systems and systems that store complex data such as graphics and audio,
Ges1gners
Application Programmers
Figure: Classification of Database Designers
They use several tools to develop
programmers are computer professionals and they write application programs.
The responsibility of database designer is to identify, dun (RAD). This tool requires little programming efort
1o
ertaces, one such tool is Rapid Application Development
() Data to be stored
Create forms and reports.
(ii) The structure of the data. o
Naive Users of
Database designer interact with all the users or database s0 as to 1dentify the requirements They simply navigate througn
of database. Each designer anything about database system.
cts with a group of users and develop a view.All ne views are then analyzed in Naive
database that satisties the requirements of all the users.
order to develop a final view of tne
re unsophisticated users. They do not know
user interface to get the data. They invoke already written and tested applications
programs through ouis

ers are classified into


Database designers are classified into two
two types. They are
types, lney are, et5hte sdn wsi Wi ided aware of how they are written and executed. These transactions are called "canned transactions
iplioa u
() Logical database designers
coRe i
seb Aone o ing
r exampl courses offerèd by a
university of Australia the student
goes througn uc
are uc
pC, I we want to know the list of the naive users. Forms
Physicaldatabasedesigners. gt The student here, is a
are one who identify the data and the relationship
elnsh t link p ovio
e does not need to know how his request
data
is processed.
they just fill in the form and
submit it. In addition, the
repor

Logical database designers the database design among the data. uSiC users interface for naive users. To retrieve any
logical physically Physical database desig
decides how to represent the ted trom the database are simply read by naive uses
SIAGROUP
yLOOk for the SIA GROUP LOGO on the TITLE COVER
before you buy
SPECT
ALL-IN-ONE
JoURNAL FOR ENGINEERING
STUDENTS
Dalabast n to Database
Design
1.24 SYSTEMS IJNTU-HYDERAD
ABAD
UNIT-
DATABASE MANAGEMENT 1.2 INTRODUCTIO 1.25
(May-19(R16), a2(b) AprilMay-12, Set-4,Q1a
TO DATABASE
Q33. Explain the function of database administrator DES
1.2.1 Database Design
OR and ER Diagrams
he ste
Explain the steps that should be taken in developing
what are five main functions of database administrator? Explain
April-11, Set-4,
Q2b) Q34. database for an organization.
Answer:
Answer: serves as a basic component of an
atabase system
hem
information system. The
following are the differertt
Functions of DBA development process of adatabase system, phases in thelife
ycle
Database Administrator is responsible for performing the following functions, StepI: Initial study phase.etemobl
Database Schema Definition StepII: Design phase.
Step I11: Implementation and loading phase
A Creates database schema (conceptual, internal) by invoking data definition statements in the DDILp
Step IV: Testing and evaluation phase.
Conceptual Schema
Step V:Operational phase.
in the entities, this is called conceptinl
DDA 1dentihes the entities important for the organization and the data to be stored Step VI: Maintenance and evolution phase
database design. The DBA executes conceptual DDL statements to design conceptual schema.

Internal Schema
Step
I: Initial Study Phase
The activities performed in initial study phase include,
DBA after identifying the data to be stored, decides how to store the data. The physical storage is defined by using intemal
DDL statements. DBA hen provides conceptual internal mapping.
) Examining the existing system

i) Defining problems and constraints


2. Database Schema, Physical Structure Modification
ii) Defining objectives
DBA perfom changes on the schema in order to accommodate all the changing requirements. DBA also modifies the
Defining scope and boundaries.
(iv)
physical structure so as to enhance the performance.
0 Examining the Existing System
3. Users Authorization
A database designer analyzes the organizational structure, organization's objective and operations by identifying the

Itis the responsibility of DBAto control the flow of data, so as to prevent it from being accessed by unauthorized users. DBA operationalcomponents along with their functionality and the way they interact with other components.
assigns level of authorities to every user, and this information is stored in a system structure. Each time a user makes a request for i) Defining Problems and Constraints
accessing the data, the authority information is checked so as to verify whether the requested user is authorized to view the requested
partof the database or not. The designer creates a paper report based on the available formal and informal sources of information. Tthis intormation
Specines the waythe existing system performs its operations, the different input requirements and the type of document generated
4. Users Interaction andthe procedure of using the output.

DBA communicates with users so as to ensure that the data is readily available to the user and defines desired extemal Initially the problem definition process may be unstructured as the end users fail to understand the organization's operaions
schemas using external DDL. He/She then provides external/conceptual mapping. rto identify the problems occurring while performing these operation. The designer then collects all the problemdescriptions that
nturn v initial declarations are
made, the designer analyEs
5 Database Maintenance wIl specity the host of the general problem descriptions. Once all theproblems
thesedecla associated within the larger trameworkof
using which the
org taon so as to generate additional information
The different activities performed while carrying out maintenance function include, these problems include,
operations can be defined. Some of

Creating Regular Backup What is the way of inter-relating the activities of diferent marketing departments?
What is the way of using the solutions corresponding to customer 's application in achieving the other organa
The data may be lost or corrupted due to the human error or hardware failure. This cannot be avoided and hence the dati
marketing department objectives?
must be loaded in some other place such that jt can be reloaded after recoyering from failure. This is known as backu
have operational relationship wiu
storage y nmuch essential to find the answers for these queries specially if they
slirug at business
modules.
Monitoring Performance li) Defining
Objectives
The DBA makes some changes
ike
tuning and reorganizing so as to enhancethe such that it solve
Inthis the organizational objectives
database designer must define o
Ensuring Availability of Free Space database initial study, the
blems identified in the problem definition process. It is the
responsibility of the designer to
ensure the objectnves

ilable free space is sufhcient tor processing and upgrades the ystem relates to the objectives of the end users.
disk if the space is
not sufficient SPECTR SIAGROUP
Look for the SIA GROUP
the SlA LOGO
2 on the TITLE COVER HLL-IN-ONE JOURNAL FOR ENGINEERING STUDENTS
before you buy
1.26 SYSTEMS (JNTU-HYDERABA
BAD
base
Databas uuo 0
DataDase Design
DATABASE MANAGEMENT NIT-7 Software
(iv) lecting a DBMS 1.27
Defining Scope
and Boundaries DBMS software that support the
designer selects a data ase application
ln this activity, the database designer database application. The scope define critical to the information system and therefore performing logical
defines the scope and boundaries of a the rocess is very
proce must be performed such design. This
extent of the design in the system boundaries and the wav electionfiunctions eefficiently. Follow
lowing are the steps considered that the selected software
terms perational requirements. It is necessary to identify ns while selecting a DBMS, caries
must inciuae not only the exie it
system. These boundaries outall referenca
users and application areas but
parts of organization's infomation hardwa Defining the terms of
also the future users and applications. Boundaries are defined based on the existing and (a)
products
software that are selected in such a accomplishing the defined system objectives.
way that these are capable of Selecting two or three DBMS
(b)
Step I1: Design Phase c)Evaluating the selected produc
In this phase, a database
model is designed to support organizational operations and its objective.
rolowng are the differens
erent )Selecting an efficient product.
approaches considered for designing the database model, Database Design
Creating a Logical
) Top-down approach 3 The entual
conceptual database design isis refined
ref and mapped onto logical database. This is independent
of physical level
nd is derived based on data model. The logical data design is normalized
(i) Bottom-up approach to avoid redundancy. However, in
uiez bitu salbareah npleme
DB IS the taskof logical database designer is to convert ER schema into relational database schema. The design requires
ii) Inside-out approach elationaect must be mapped with specific constraints that are used while selectingthesoftware. The logical design basically
(iv) Mixed-strategy approach. he
converts
software independent conceptual model into software dependent model by defining the required tables domains

Physical Database Design


Top-down Approach enp i, leiiatp Creating
aarsoig esitrite Creating physical database design is a procesS wherein the characteristic features of data storage and data access are selected
For answer refer Unit-I, Q35, Topic: Top-down Approach.
ce characteristics specifies the type of device, data access supported by the hardware and system respectively. The design of
(i) Bottom-up Approach Jhase can influence both the data location as well as the system's performance. This process becomes difficult when datais
Hributed across multiple locations. This is because the performance of the system is affected by the efficiency of communication
For answer refer Unit-IL Q35, Topic: Bottom-up Approach
eribe,i di Logical and physical database design can be performed parallely in hierarchy and network models.
(ii) Inside-out Approach and Loading Phase
StepI1: Implementation
This 'approach is similar to botitom-up approach but the difference is that, the inside-out approach initialy identify the application process can be implemented. The database
After the completion of all the design activities the database and
structure and
major entities and then their relationships and attributes. is implemented using Data Definition Language (DDL) of
a GUI. DDL statements are used for creating database
parts of application program
iv) Mixed-strategy Approach empty database file. application program is implemented using 3GL or 4GL languages. The
The
DBMS.
corresponds to the database transaction that are implemented using DMIL of target
This approach uses both top-down and bottom-up approaches for different parts of the database model prior to merging are also implemented using DDL. During
all the parts together. In this step, thesecurity and integrity controls associated with the applications recovery
mplementation and loading phase, the user must consider certain
criteria regarding performance, security, backup and
Following are the activities performed in the database design phase,ne3o/ionajs ateies k loading the existing files into the new database. This utility generaly
DBMS have a utility program that is responsible for utility performs data
1. Creating a conceptual database design. and destination databases. Once the specifications are known, the
equires the specification of both source process, a proper
performing the loading
ailtlopkyel Onversion wherein, data is converted into the required
format of database files. Before
2. Selecting a DBMS software between the entire conversion operation.
Paning 1s to be made so as to ensure a smooth
transition
3 Creating a logical database design.
StepIV: Testing and Evaluation Phase
constraints and to
Creating a physical database design. performance integrity, security
4. so as to verify the
dse administrator performs the testing phase developed database application by
employing diferent
detect thoroughly test the newly application progran au u
Creating a Conceptual Database Design er the application. It is necessary to the
in and realistic data. If testing is performed
successfully, then the errors present in
and application
program are
Conceptual database model must provide a clear understanding regarding the functional and business area of a database gies verifies whether the database
database structure are uncovered. In addition to this, testing also
application. Here, data modeling technique is used for creating an abstract database structure that corresponds to real world entities developed
in
.uure
accordance tto the specification and whether
all the essential
performance requirements are satisthed.
program basIcaly use
The conceptual database design does not include physical level implementation details and therefore can be easily understoo dcordance application programming. The
are the steps considered while designing a conceptual database. The es performed parallely with application, while
programcodung
even by non-technical users. The following evaluation phases are a prototype ofthe
aben and
Ools (screen painters, menu generator,
report generator) to develop
the inadequate or
correct functioningfeanues
Collecting and analyzing the requirements. in order to identify system developersd
(a) Pertormed. Prototype is a working model used by the users requirements of users and ng the
he advant. helps in
understandingg the
fulfilled while implementingt
Modeling and normalizing E-R model prototype is that, it evaluation criteria are not sottware
(b) in evaluating eloping system
the feasibility of particular syst design. If any of the
logical design or by
upgrading the DBD S
Verifying data model. the physical,
uatabase,then by modifying
(c) orhardware.
the system must be enhanced either
stem GROUP
distributed database. hardwar SIA
(d) Designing SPECTRUM STUDENTS
ALL-IN-ONE JOURNAL FOR ENGINEERING
the SIA GROUP LOGO
2 on the TITLE COVER before you buy
1.28 TU-HYDERABAD
SYSTEMS [JNTU-HYDER Database
tabase System
Applications, Introducction to
DATABASE MANAGEMENT Database Design
Step V: Operational UNIT-1
1.29
Phase liada
atabase application is said to be operational, ifit has successfully undergone the evaluation
pnase. 1he operational
initiates by performing
system evolution process. In this phase both minor and major issues that remained undetected da
testing phase are detected.
Step VI: Maintenance
and Evolution Phase User view- 1
User-1
Database administrator is responsible
of these activities include, for performing the maintenance activities on regular basis within the database
Some

) Performing preventive, corrective


and adaptive maintenance
(1) Preparing system usage summaries
and security audits periodicaily
(11) User vie W- 2
Granting the access pemission to new User-2
and existing users

comaton and the components within the database evolve and therefore require some min0r Cnanges to be performed
Thi evoution 1s because of
new information requirements, new query formats and demand for additional reports. These
sort
Cnanges can be performed only if the design of database is flexible and if the documentation available updated regularly. of
is
Q35. Name the main steps in the database design. What is the goal of each step? In which steps is the
model mainly used? ER Al users view
User vie W -3
User-3 ER model
Answe
Thereare two approaches for database design,sn spin ae, bralle eydol gicare ieiano9e Figure: Requirement Analysis

on
Top-down approachep After requirement analysis, the designers design based on what data is required, what are the applications used
that data and frequent operation performed.
2 Botom-upapproach.t etre len ilg n dsye b
T
Top-down Approach () Conceptual Database Design
includes all the entities
Top-down approach begins with design of data models. The high level entities and their Once all the requirements are available, a conceptual database design is developed. This design
relationships are explained in hence is easily understood
and their relationships. It does not include physical level implementation details and
thesedata model.The low level entities are understood along with the design process using top-down approach. requirements are met and are not
model uses top-down approach and is suitable for complex databases.
Entity relational even by non-technical users. This is used only to satisfy the users that the specified

. Bottom-up Approach
contradicting.
(Gi) Logical Database Design
Bottom-up approach begin with the collection of entities and their
relationships. It is suitable for designing simple databases logical database design. This is also independent of
with few attributes. The conceptual database design is refined and mapped onto
on data model.
physical level implementation, but is derived based
Inside-out' and 'mixed strategy are the two otner approaches 10r dalapase DBMS, the task in
redundancy. However, specific to relational
design.,e rleo o ooaol 2d1 The logical database design is normalized to avoid
Database Design Approach
do o p i
h aieiw rofyn h 1ogical database design is to convert ER schema
into relational database schema.

oBeyond ER Design considers the


Top-down Bottom-up Inside-outMixed Strategy ER model. Once the logical
schema is defined, designer
ne irst three steps are more relevant to the measures.
07eninglun.aest provides certain security
Figure: Approach for Database Design paysical level implementation and finally

Top-down approach is used for ER models. lt involves six steps in database design iv) Schema Refinement
9 problem, which is called
process potential problem and solve the
Collection and Analysis analysed to identify the
Requirements entities and relationships are
as schema refinement.
The database designers collectthe information of the organization and analyses,
the information to identify theuSC () les are
requirements. Physical Database Design structure, indexes and clustering
tabies
in this step. The
storage
The information is collected using techniques called fact-finding techniques. implementation details are focused is further refined,if
required.
ollected and analyzed
The information colle Paysical estimated and the database schema
documented and called "requirement specincation, The expected load is
The informal
is poorly d n this phase.
ted into more structured form using requirement specification techniquesstructured at this stage and latc (vi) Security unauthorized access 1o
a Design is required to
avoid
The requirement of each user is evaluated and a final model is developed that
a security features. This
is to include
satisfies all users. p Ot database design GROUP
Look for the SIA GROUP LOGo
on the TITLE cOVER
before you buy PE
database.
ALL-IN-ONE JOURNAL FOR ENGINEERING STUDENTS
SIA
1.30 DATABASE MANAGEMENT
HYDERABAD
SYSTEMS IJNTU-HYDE
abase Syst
Database System Applicatons, Introduction to
INIT-1 Database Design
Requirc ment AnalysIS 1.31
Key more
Akeyis
of one or more attributes that can uniquely identifies
a setCone
Concepfual Database Design lates each row in a table.
also two or more tables. Ihe attributes A key not only identifies rows
tablebut like S_ROLLNUM, EMP_1D, the
DEPT_NOetc., can be
ofa
of Contain unique values. usedas
Logical Database Design ce they
a partial key? How is it represented in ER diagram?
H
Wh at is Give an example.
a37.
Schema Refinement
Y Answer:
Fhyscal Database Des ign PartialKey
y or discriminator is a set or attributes
that enables the user to distinguish
Secunty Des ign attributes in weak entityset.In other
can a lco be defined as a set of attributes that ca: uniquely identify weak entities
Figure: Phases in Database Design words it related to the same owner'sentity.There
aresituations in which ac
a composite attribute assoCiated with weak entity attribute may also be a partial key.
primary key of owner's entity set The primarykey for
22 Entities, Attributes and Entity Sets, Relationships and Relationship weak entity set is a combination of and partial key of weak entity set.
Sets
Q36. Define the
tems, entity, entity set, attribute, key. Representation of Partial Key
Answer (April/May-12, Set-2, 02(a) |April-11, Set-2, 01/b In ER diagram, the name of partial key attribute is represented with a dashed or dotted line..
Entity
Nameof partial key
An entity is a real-world object
that is distinguishable from other objects, In ER diagram an entity 1s represented by
rectangle (entity box). The name of the entity is a noun a
and its written in the centre of rectangle. Whenever, ER diagram is applied Example
to relational model, an entity is mapped to relational table wherein each row represents an entity instance.
Example
Consider the following E-R diagram

STUDENT CUSTOMER DEPARITMENTalu taatesi


Eid Ename Eprojec DName

Entity Set
tuobuiuta Employee Dependent Dependent DOB
Anentity set is defined as a group of entities that have similar types or attributes. For instance, employees working in an
organization are defined as entities E,, E, E, E, which may contain similar attributes
defined under a specific entity type
called "Employee Here, the group of entities i.e., {E, E, E, Edepartment)Ephone DRelation
E...
is referred to as an entity set.
Every attribute of the entity set has a set of pairs defined by (attribute, data value). Figure
or the nature of the entity. Example, an "employee entity is defined by a set of pairThis will help in describing the characteristic
(Emp _street, NorthMoody). (Emp_city, Ilionis)}.
as, {(Emp_name, John), (Emp_no, 0025), In the above E-R diagram, "Dependent" is a weak entity and "Dependent isa weak relationship. Inthisdiagram,if
of
dependentof same employee does not have same name, then the attribute "DName" of dependent entity is partial key a
If an entity set contains enough attributes for creating a primary key, then it is
hand, if an entity set does not contain enough attributes for creating a primary key then termed as strong entity set. On the other 038.
What is the composite attribute? How to model it in the ER diagram? Explain with an example.
it is termed as weak entity set. Typicaly,
member corresponding to a strong entity set is called dominant entity whereas Answer April-11, Set-1, Q3[b)
member corresponding to a weak entity set 1s calleu
subordinate entity. Composite
Attribute
Attribute
different domains.
Oposite attributes are those attributes that contain two or more attributes from
Anattribute is defined as a property that describes the characteristic feature of a particular
the qualifier that provides additional intormation atbout ine entuty, Generally, an attribute is entity. It can also be defined a n attribute which can be further divided into smaller components is called 'composite attribute'
an atomic unit of information assocla and basic attnbute
with the named entity. This intormation helps in uniquely defining an entity. each component is expressed as a simple
with a nh COmposite attribute is divided into smaller components
as a basic
address as a composite attribute
attribute whereas his
In ER diagrams, attributes are represented by ellipse and the name of attributes meaning. Suppose 'STUDENT' is considered
ues'student' entity include name,
attribute is linked with the respective entty. Example, Une attribules associated with the written inside
of the
ellipse. Each or
inside the ellinse
which incl
ncludes,
S,
nt House number, this can be represented as,
City, Area, Street-number, HOUse
roll-n0, 0
phone-no, address. These attributes are represented as,
Student address
roll-no
House_mumber
Streetnumber
phone-no) ocoicilag City Area
(name Student
g of Composite Attributes in ER Diagra objecisanu
users in the form of
Entityrelationship1 real-world enterprise to their Zip-code 1ns
address relations. explain the information of includes attributes like City, Area, Streetand
Supp Student address that
e represented posite attribute is a GROUP
epresented
LoOk for the SIA GROUP LOGO
on the TITLE COVER
before you buy
PECTRUM
as,
ALL-IN-ONE
ONE JoURNAL FOR ENGINEERING
J0URNA
STUDENTS
SIA
JNTU-HYDERABA Databa ysten roduction to
Database
DATABASE MANAGEMENT SYSTEMS TJNTU-HYDERa uUNIT-1 Pesign
Sets
Shad name
Rilationship 1.33
allection of similar relationships is calle
a relationšhip
sét and isdenoted
by a thom
Student Studies
STUDENT
Compos ite attribute Figure: Student.class
Relationship

Stud address pegree


associated with a relationship
entities asso
Centities
Thenumber of set is known as degree
of entities.
Cty Street
Zipcode Relationship
Area ry
ary relationship the association i1S
within a single entity.

Coume
Where 'STUDENT *****
is an object with attributes as Stud name Stud There is also a possibility further
ute nke street into attributes and id. of furt subdividing
like Street number, House number making them as simpie auouc piets
PpOSe a regular entity type consist of a composite attribute, so as to form a new relation,
that composite attribute are onty simple components
considered. of Figure
Example
Car example, it is not possible to opt for JAVA until the course in 'C' is being finished and
Supposea student address is a composite attribute leted JAVA. This kind of relationships are for 12EE one should have
which consist of subparts like street, city, state. Hence, shown by unary associations.
15mapped to the STUDENT relation, only if a regular entity
the simple attributes like street, city and state are included in the relation. Binary Relationship
STUDENT

Studi
Stud name Figure
Stud address
A relationship that associates two entities is known as binary relationship.
(Street, Cty, State)
Zp code Ternary Relationship ttajelad
STUDENT
Extra curricular
Stud 1D Stud Name Street City State zip_code
Student Studies
Simple attributes
STUDENT relation can also be modeled by using Figure
simple attributes for Stud_name like
name. Hence, simple attributes increases the data
accessibility and maintain quality data,
Last name, Middle_name, First
of ATelationship that associates three entities is known as ternary relationship
If an address is a composite attribute and consist ot components Quaternary
is being called), representation of the composite like Zip, Street etc., then
based on the reference (how
Relationship
attputes
components are included in the ER diagram. Otnerwise, ER1sdone 1.e, i1 references to Zip and Street are made then only these
diagram will not contain its components. Extm curricuar

Address

Street Student Studies

Q39. Explain relationship and relationship sets.


Branch
Answer
Model Paperd, Q
Relationship Figure
Relationship es the association among twoenanes.
actudies in class".,
are associated as "student studies in
ctass, Hence studies is
consider two entities such
relationshio hetu
is a relationship as a student and
a class. These e tities
p nat associates with four entities is known as
quaternary relationship
between the two entities, A relationship
student and class. can also have an attribute called a descriptive attrnbule
Look for the SIA GROUP LOGO GROUP
2 on the TITLE
CoVER before
ECTRUM
ALL-AN-ONE SIA
you buy JOURNAL FOR ENGINEERING STUDEN
(JNTU-HYDER DatapaseSystemAPpnoauoS,
Syst Inroduction to Database-Desig
1.34 SYSTEMS JNTU-HYDERABA
DATABASE MANAGEMENT AD ut-1 ER-diagram represents that customers ould fi identifythemselves 1.35
g abov should be able to browse the catalo
they ofa shoppingsystemsu as by úsing
Jabong/Flipkart
que customer identification
Studies Course Then diagram are, and can place order online
Student oumber: in above
entities
The
Customer
Timings with c id, cname and address. Here cid is the primary key of customer entity.
e Figure
Books
or example, student takes a course at an institution. Then the relationship among the two enuties 1.e., student and cou o
i, strong entity with
isbn, title, author, Qty an stock, price and year
published
studies. Each student can choose from allowable time schedules. Hence timing can be consiIdered as, an attribute of relae
atior
shi Itis
studies ayment
Role (i) ntity with cash-on delivery, ATM card and debit card.

not always required, as it is in


Itisa1
in therelationship is called 'role'. Specifying roles is elationships
However in special relati a relationship with different rol diagram following binary relationship exists between the entities.
recursive relationship, where an entity participates
in roles.
p uke
Inthe above ER
Emp loyee Books
Student Orders
Manager

Work for of ER-diagram, "orders is the relationship between customer and Book entities.

Makes Payment
CUstonmcr
|Organization

Figure 1a this partof ER diagram "makes 1s the relationship between customer and payment entities. This relationship is refen
as identifying relationship.
In the above ER diagram, it can be easily interpreted that employee who is a manager works tor an organization.
anon. If the
the 0 as identily 10

roleis not specified,it is not possibleto know the post ofthe employee 1.2.3 Additional Features of the ER Model
Q40. Construct an entity-relationship diagram fora online shopping systems such as Jabong/Flipcart. Quote ER diagram
Define ER model and explain the following kinds of constraints that can be specified the
the in
ouassumptions and list the requirements considered by you for conceptual database design for Q41.
above system. and give an example of each.
Answer: May-15(R13), Q 0 Key Constraints
() Participation constraint.
cname address Nov/Dec.-18(R16), Q3(a)
Answer :
ER-Model

Belongs For answer refer Unit-1, Q23, Topic: The Entity-Relationalship Model.
Customer Makes Payment_mode
to
0Key Constraints are
Ship_date) with a relationship. These restrictions
laid on the level of association that an entity has
One line erain restrictions must be
Cash on ATM card called key
constraints.
shopping Orders Qty a key constrainis.
time. This restriction is called
portal delivery or example, a student can study in almost one school at a
Order-data) Payment
Debit card amt Student Stuies School

Contains Books
Key Constraints
s Figure: ER Diagram With
Oty in stock one-to-one, many-to-one, many-lo-manyilot
or Ce, relationships can be classified into
isbn
Tile Price
(Year_Published Relationship
prem
Author
Many-to-one Many-to-1many
biiFigure One-to-one
e Figure: Classification
of Relationships GROUP
Look for the SIA GROUP LOGO on the TITLE COVE SIA
STUDENTS
ROM ALL-IN-ONE JOURNAL FOR ENGINEERING
Applica
Database system cations, Introduct
to Database Design
1.36 DATABASE MANAGEMENT
SYSTEMS JNTU-HYnE 1
DERABADUMIT1
Example anmple 1.37
an ER diagram representing information of a R

PRINCPAL Runs SCHOOL Name


Name Number
Figure: One-to-one Relationship
Home
groun
SCHOOL Onst CLASSES
Utes

Players puys
Figure: One-to-many Relationship RUGBY
on
Ieam

STUDENT 0OURSE b at
Figure: ER Diagram for Weak
Entity Set
Figure: Many-to-many Relationships
ntities of the entity set "Players (1.e., name, number and role) cannot
ASChoolcan have at one principal. Hence, here is a one-to-one relationship. However, a school can be identifñed uniquely, as other teams may
orclasses. Hence,they havemost
one-to-many relationships. Any number of students can opt ror any nunOr
have any numb ver with same name, number and role. Therefore, the entity
set "Player is a weak entity set. This is because
to-many. COurses, hence many identify entities of this set it must be ncluded with one in-
order to id the or more "Many-one relationships" and "Key" of the related
a
() Participation Constraints mtities from the connected entity set (1.e., Rugby teams).

Entities can participate in a relationship either totally or partially. Class Hierarchies


D

partial.
if every entity in an entity set, participates in a relationship ofrelationship set, then the participation is said to be total ele Class hierarchy is a method of classitying the entities into subclasses
entifies that represent the subclasses can inherit the
i.e, entities can be derived from the parent class.
ne attributes of parent class entity and even can have their own entities. For
instance, consider a "Person entity set as the parent entity with attributes name, address, age.
Forexample,all the student will study in the school but only few ofthem participate in extra curricular activities. The two subclasses of this entity
sef are "Student" and "Teacher. The attributes for "Student" include attributes for "Person"
afbReues "Teacher" include attributes for "Person"
plus Course and the attributes for
Stades plus Lecture. Therefore, it can be said that the attributes for "Person" are inherited by
Sudent" and "Teacher" and that both these subclasses are "ISA" person. It is even possible to classify the entity set "Peson'
based on different criterion like Senior_Person simply by adding
Figure: Total Participation a second ISA node to the "Person" entity set.
Constraints Associated with Class Hierarchy
Extra curncuar
activties Thefollowing are the two constraints defined for class hierarchy.

Figure: Partial Participation (a) Overlap constraints


Q42. Write short notes on the following 6) Covering constraints.
) Weak entities 0 Overlap Constraints
(i) Class hierarchies. entity. For example, it is not possible
SC Constraints determine whether it is possible for the subclassesforto have same
for "Alice to be a Teacher and a Senior Peson. in
Answer to be both a Student and a Teacher. But, it is posible "Alice"

() Weak Entities u Situation, it can be said that Teacher entity overlaps Senior_Person entity, which is denoted as "Teacher
Senior_Person".
OvertapS

Weak entity is the one that depends on other entities for existence
0) Covering Constraints
A weak entity cannot be identified uniquely as it does not have sufficient entities everyindividual entity of
uniguely unidentifiable, by associating it with another to form a primary key. It can be ma he it is necessary for the entities of subclasses to
include
entity set called identifying orowner i nstraints determine whether Smdet
the weak entity set. The relationship among the two entity seis 1s called identifving entity set. The owner entity set "o "Person" in one of its subclasses (1.e,
relationship. TTeacher).ss. For example, it is not necessary to include every entity of
always many-to-one and its participation is total. The identifying relationsh
Although weak entity set i5 not provided with a primary key, lass Hierarchy
there is always a Representation
weak entities. The discriminator 1s a set of atributes that enable us to distinguish attribu need to distinguish among attriou
alributes in weak entity set. The discrim The following
is also called partial key. are the two ways of representing a class hierarchy,
primar, for weak entity set 15 a combination of primary (a) Specialization
key ofthe owner we"
koy of
entity set and partial key
entity set. 6) Generalization. GROUP
Loo t for the SlA GROUP LOGO Y2 on the TITLE COVER
SPECTRU

JOURNAL FOR ENGINEERING


STUDENTS
SIA
before you buy N-ONE
1.38 IJNTU-HYDERABA
(a) DATABASE MANAGEMENT SYSTEMS IJNTU-HYr Database
tabase System Applications, Introducti
Specialization uNIT-1 tabaseDesign
State and explain variou features of E-R models.
Allthe entities within an entity set do'not 43 1.39
share all the attribue Answer
p, n a school database, E-R Mode
lodel
addition, they have teacher and student entities have same conn attributes like name, street aturesof Paper, 03(b) | May-16(R13),
extra attributes like andcity followings are the features of Entity-Relationship 03)
uke teacher has empid, salary and anu student has studentid, marks etc. The f model,
u enaty person rotity-Relationship model is easily understandable
can be defined so, it
teacher. This sub with attributes name, street and city which w further
can be subdivided into
into student ioner to communicate with end users. requires less training.
grouping is known Hence, it is widely
as specialization. and used
sedbyby thedatabase
af construct to co
convert into relational
lt is a process It makes use or tables 2
of identifying the and correctly maps to
e superclass is defined followed subsets of an entity set each of which have diferent characteristic features. In this process e database developers to design andimplement therelational model.
It is used
by the subclasses definition. After defining the superclass of subclasses, the attributes the data model.
associated with these
subclasses are defined. relationshin eis used as a fundamental entuty in other models. n
A

lescribes relationship that exist between the entities,


de h
City n describes system data and the relationship among
Street Itever them.
City Ktended Features of E-R Model
Some of the extended features of E-R Model are,
Key constraints
PERSON Participation constraints
Weak entities
3
4 Class hierarchies.
Forremaining answer refer Unit-1, Q41 and Q42
nAA
Discuss with an example how we can use ternary relationship
instead of aggregationin ER diagrams.
Answer:
AprillMay-12, Set-2, 02(b)
Student Ternary Relationship

at hezovi
0 eut sizie g Figure: Specialization354 1lc al
Extracurricular

(b) Generalization
rad iat f
Generalization is a special case of specialization.
a t dyo ug,3oi02 sit noirneit sabo bo otalco-to 30eogl ed Esc Student Studies Chss

The design approach may be top-down or bottom-up. In Figure


top-down, the entities are identified
in abottom-up approach, all the low-level entities are grouped to form a high level entity. and are subdivided. In contrast,
Arelationship that associates three entities is known as ternary relationship.
Aggregation
For example, designer may first identily attributes of student, teacher
and then group common attributes into a, highet
entity. This is known as generalization. t 1s the concept which specifies the participation of one relationship set into anotherrelationship set.ConsidertheER
gramgiven below showing relation between STUDENT.
lsien hor t l o u
daan osites
ota,sld
Employee
-****

bnesn2 u dlod bd ooiA (S-name


S-addr
C-ocaton
S-ID S-branch Affinted
Since university

Software Engg. cOLLEGE


CEO STUDENT
Manager

Figure: Generalization ---

The high-level entity is called super class and low-level entity is called subclass Admsso
a plleiescil lesiilk Until Mantains

In the example, employee entity is a super class of software engineer, CEO, manager alsosay
trihustes of employee entity have been inherited by software engineer, CEO, manager subclass entities. We canengince
entities and that software
d to eliisb udb orad
6
(Dept-branch)

ISA employee.
Involving Aggregation
Figure: ER Diagram
A for the SIA GROUP LOGO FIA GROUP
IJNTU-HYDED.
HYDERABAD ace Sve
Dalabase System Appiauo, uoaucuon to Database. Design
MANAGEMENT SYSTEMS UNIT-1- Objec is Binary Relation por aTernary 1.41
1.40 DATABASE an Relati
maintains the jomng details of the
STUr Identifyingif
is said to participate în
Joins relationship as it replace a. -binary relationship by distinct
nshp aggregation. Now, the Joins relation can be treated
as,an entity set which
define desired to
always a number of binary relationship sets.
Thedashed box around the Joins relation indicates
the Maintains relationship set is Derived attribute
attri
maintain there own information (i.e., butes)
Owever, aggregation is used when there are two relationships thatneed to ta an attribute, Since which mainta:
ntainsthe
n neabove example, Joins and Maintains are two distinct relationships as joins contain
contains an aurloutes until which maintaing
mai.
aaies irom when the students has joined the college whereas the maintains relationship
the dates until when the students are present in the college.
be maintained then in
its own information to
ang relationship (maintains in example) does not require uch
shown in ngure Deio
o On, U 1S preferable to use the ternary relationship instead of aggregation as

dept-no dept-branch ge airoeb o s Figure: ER with Ternary Relationship

KK
LA Derived atributeD
Admiss ion-dept

so
STUDENT Joms COLLEGE utg

Afliated Figure: Replacing a Ternary Relation with an Entity


S-id S-name (S-addr)-branch (C-name (C-location
entity with binary entities, simply create a
universtyY new
Consider the above ternary relationship. Now, in order to replace ternary
entity E. The attributes of the relationship set are assigned to
entity 'E. Then generate three distinct relationship between entity
Figure: Ternary Relationship Instead of Aggregation
and other three entities.
Therefore, the selection of aggregation or ternary relationship can be determined by the presence of a relationship that
associates a relationship set to an entity set.

1.2.4 Conceptual Design with the ER Model


Q45. Explain in detail conceptual design with ER model.
Q30)
Answer st itnottas Model Paper-l, D
Fordesigning an ER model, designer needs to make dificult choices like,
Figure: ER Diagram with Quard Relationship
) Should the object be an entity or an attribute?
i) Should it be binary or ternary relationship?
rsbl aluoibout na
ii) Should aggregation be used or not?
(iv) Should it be an entity or relationship?
Identifying if an Object is an Attribute or an Enti
1)
Consider the student database for an institute. lt is posSible that each student may opt for two or more courses. The decis
as an entity is difficult to take
B
whether to model the course as an attribute or
Ifa student is restricted to take only one course at a tume, the course can be modeled as an at owever, if student op
course should be modeled as an entity. It can be argued that 'the multiválued
for several courses, the course' can be modeled asSI
1s always better to model it as an entity. Since
attributes. But in real world, it it enables the user to have
the details of
duration
etc. Hence, when generality is more required it 1s better to of
f each course, fees paid
pf model an object as an entity 1ns ead Ae
multivalued attribute
GROUP
cbbD SIA
GROUP
Look for the SIA
LOGO on the TITLE cOVER SPECTR
before you buy t LIN-ONE JoURNAL FOR
ENGINEERING STUDENTS
1.42 TU-HYDERABAD
1JNTU-HYDES fDatabase System Applications, Introduction
DATABASE MANAGEMENT SYSTEMS UNIT-1
Database Design
dentiylng if an Object is
an Aggregation or Ternary Relationship
1.43
nc choice of aggregation
or ternary relationship depends onthe folowung
() Relationship between
relationship sets and entity &C

(iv)
(Gi) Integrity constraints.
ldentilying if an Object
is Entity or Relationship
A
Consider a student database for
upon the budget assigned an institute. Here, it is possible that every student may develop the project
base
to them by the department. So, every department has an unrestricted project bubudget, as shown User-1
figure,
in User-
requirements
Stud addres
stud name dept name)
Stuad id stud dept) dept 1d dept_budget
Conflicting Conceptual
Project requirements view
Student Department
development resolved and
requirements Database
satisfied by all model

User-2 generated
User-2 requirements
start
P
date mhude In the other method, the user provides his requirements, the designer generates a conceptual view for the requirements
Figure: Entity Versus Relationship Like wise all the conceptual views from all user requirements are generated and a comprehensive conceptual view that satisfies

Here,
the project is known to the department and the allotted budge Themethod works well, if the relationship proje allthe requirements is generated.
development gets individual and unrestricted budget for every department.

On contrary, if that unrestricted budget is meant for all departments, then the project development
relationship holds same
value in thep-budget field. As a result, redundancy may cover entire tabular columns. In essence,
tables will be display same
values. Apart from these problems, the method cloud be misleading. Here, the budget is
concern with the relationship
but in
actuality it is concern with the project.
However, the problem can be resolved by designing new entity set called projects
and the respective attributes p-start date
and p-budget signifies the project entity and attribute. Subsequently, every project has budget and has different starting date in

cach department. User-1 Conceptual


User-1
Such type of scenarios occur due to imprecise nature of ER-modeling. This makes even requirements View
more difficult in identifying e
underlying entities.And the users starts associating attributes along with relationships instead
of their respective entities. Thus
leading to redundant storage of same information.
Conceptual
Q46. Explain briefly conceptual design for large enterprises. View
Database
Answer:
model
Designing database for large organization involves more than a single designers, It diagrammatically
represents the comp
database and enables the user who provide 1npuis to dalabasc, 1o understand the complete functionality of database.
methodologies. User-2 Conceptual
Large databases are modeled in two
User-2teho requirements view
ivements of all the users are collccted. 1e.contictimg requirements are resolved
and a final conceptual v
generated that satisfies the requirements of all users. GROUP
SIA
Look for the SlA GROUP LOGO
Y on the TITLE COVER PECTRUM ALLAN-ONE
JOURNAL FOR ENGINEERING
STUDENTS
before you buy
1:44 NTU-HYDERABADI
1JNTU-HYDEB e.1 Database System Applicatic
ions, Introduction
DATABASsE MANAGEMENT SYSTEMS UNIT-1 to Database Design
Q47. Construct an
ER diagram for a
deposits, lockers. bank database. Bank
Determine the
maintains ersAorl-41,Set4,
data about customers, their loans
their , Relationships
1.45
entities and relationship e above ER diagram, there exist
03 Intr binary relationship
between the entities.
OR
Develop an E-R Diagram Custoner
for Banking enterprise system.
Answer: May-19(R16),
02 In this part of ER diagram, "borrows is the relationship between customer
Storage infm) and loan entities.
Customer
Lockerno)
bcker
t of ER diagram, "makes" is the relationship
Aentifving relationship since between customer
it associates the and deposits entities. Thisrelationship
customer).
weak entity set (1.e., deposits) isrefermred
with theidentifying entity set
Qastam (ia
Loan amtLoanno
Cusci Customer

Customer borows Loan In this part of ER diagram, "has" s the relationship between customer
and locker entities.

iv)
Loan
K Paymen

In this part of ER diagram, loan-payment is the relationship between


loan and payment entities. This relationship
referred to as identitying relationship since it associates is
the weak entity set (L.e., payment) with the identifying cntity set
i.e., loan).
048. Construct an ER diagram for university registrar's office. The office maintains
including the instructor, the enrollment and the time and place of the data about each class,
class meetings. For each student
class pair a grade is recorded. Determine the entities and relationships.
Answer: April-1, SatM, 030)
Deposits at name
Payment
t phonen

DeponikamCeposik da Student
aynent a PaymentLno)Payment date

Figure: Bank ER Diagram


Entities
The entities in the above ER diagram are,
Customeer emeser
Itis a strong entity or identifying entity with Cust d, Cust name,Cust_city as its attributes.
Here, Cust id the prima Counse-ofierings Couse
key. is

ii) Loan tane


It is a identifying entity with Loan amt and Loan no as ts attribules. Here, Loan_no is the
primary key.
(Gi Payment acbes

It is a weak entity with Payment amt, Paymentno and Payment date as its attributes.
Here Payment no is the partial ko
(iv) Deposits
lt is a weak entity with Depositamt, Deposilic_dale as ts attrnbules. Here Deposit amt
is the partial key.
Locker
(v) nst a
It is a strong entity with Lockcrno, dogen as i1s attributes. Here, Locker
no University Registrar's Office
is the nrimarv Figure: ER Diagram for GROUP
for the SIA GROUP LoGO
-SIA
on the TITLE cOVER RLL-AN-ONE JOURNAL FOR ENGINEERING STUDENTS
before you buy
1.46 J-HYDERABAD iatabase sSystem Applications, Introduction to
Database
DATABASE MANAGEMENT SYSTEMS
(JNTU-HYDER INIT-1 Databasé n
Entities Patients are identihied by an SSN, and theiry
wep names,
addresses, and ages
must be recorded 1.47
The entities in the above Doctors are identified by an SSN. For each doctor,
b
ER diagram are, the name, special
y and years
1. Student caeh pharmaceutical company 1s identified of experiencemust
be recorded.
by name and has
a phone number
It hdrug,
aSurong entity with stu id, stu name, stu phoneno and stu- address as its attribules. iere, stu 1d is the prim
rimary each drug, the trade name and formula must be
of "student' entity. key (d) For recorded.
and the trade name identi
entifies a drug uniquely Each drug is sold
from among the by a given pharmaceutical company,
products of that company.
Course-offerings is deleted, you need not keep track of its products
any longer Ifapharmaceuticalco mpany
It is a weak entity with Each pharmacy has a name, address and phone
semester, year, time and sec_no as its attributes Here, semester, year and sec_ no are partialI keys
of course-offerings
entity
ke
number.nf
3. ( Every patient has a primary physician. Every doctor
Course has at least one patient.
() Each pharmacy sells several drugs and has a price
with c_no, c_credit, c title and c syllabus as its attributes. Here, c no is the primary key of'coursat
urse
for each. A drug could
be sold at several pharmacies
entity. could vary from one pharmacy to another and the price
. Instructor Doctors prescribe drugs 1Or patients. A doctor
could prescribe one or more
could obtain prescriptions from several doctors. drugs for several patients, and a
Each prescription has a date patient
Surong enuty with inst_id, inst name, inst dept and inst_title as its attributes. prmary
instructor entity.
ierc,
nst 15 e key of SSume that, ifa doctor prescribes the same drug for
and a quantityassociatedwith
it.Youcan
the same patient more than once,
needs to be stored. onlythe lastsuch prescription
Relationships
n the above ER diagram, there exists following binary relationships between the entities, Pharmaceutical companies have 1ong-term contracts
With pharmacies. A pharmaceutical company
several pharmacies, and a pharmacy can contract can contractwith
eabi of bero with several pharmaceutical companies.
For each contract, you
(isol have to store a start date, an end date, and the text of the
contract.
1 Student nrois Course-offermgs () Pharmacies appoint a supervisor tor each contract.
There must always be a supervisor
for each contract, but the
contract supervisor can charge over the lifetime of the contract.

Draw an ER diagram that captures the above information. Identity any


ln this part of ER diagram, "enrols" is the relationship between student and course-offerings constraints that are not captured by the ER diagram.
entities.
ge address
specality
Course-offerings Name
Olfers Course ep yeur

Patient
In this part of ER diagram, "offers" is the relationship between course-offerings and course
Pri physician Doctor

referred to as identifying relationship since it associates the weak entity set (1.e., course-offerings) entities. This relationship
is

with the identifying entity set


(1.e, course) date
Prescrip tio0
Name) addressphonnum
Course-offerings teaches
Instructor trade name
Pharmacy Sell Doctor
formula
In this part of ER diagram, "teaches 1s the relationship between course-offerings
start datg
and instructor entities.
price Prescriptiop
Q49. Construct an ER-Diagram for a hospital with a set of patients and a set of Associated
end date ontractV
with each patient a log of the various tests and examinations conducted. medical doctors.
text Pharm co
Answer:
(May-19(R16), a3(b)| May-17(R15), a30 superviso
Hospital ER Diagram phone num
Name
Construct an ER diagram for a hospital database with the following information,
Figure: Hospital ER Diagram
ook for the SIA GROUP LOGO
2 on the TITLE COVER SPECTR SIA GROUP
before you buy ROM ALL-IN-ONE JOURNAL FOR ENGINEERING STUDENTS
1.48 DATABASE MANAGEMENT
SYSTEMS (JNTU-HYDERAD
RABADI

EXERCISE QUESTIONSte
1. List the advantages ndyhatitoeb,
and disadvantages of ER-Model. t2
Discuss the extended features ER-diagram.
of
a guuo e hsoa o
3. List the features of DBMS.
n
the drawbacks of using file system data management.b gt toertzan
i ots aba
Describe the historical evaluation
of hierarchical, network and relational database systems.

ni 9diaho

odo)

You might also like