Dbms Database and System Applications
Dbms Database and System Applications
R9VE r33eloE1 (
PART-A
SHORT QUESTIONS WITH SOLUTIONS
MWhat is DBMS? What are the goals and advantages
of DBMS?
o0 OR
.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
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
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
PERSON
FLIGHT Deptr
Same)Sad C-locatkon)
Afiinted
SD ranch Since C-name university
eegt Student Extra curricular
involves
activities
COLLEGE
STUDENT
Partial participation
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
Answer
Define DBMS. List database system applications.
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.
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
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
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
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.
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)
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
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
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
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.
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
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
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
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
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).
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.
() 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
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 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
KK
LA Derived atributeD
Admiss ion-dept
so
STUDENT Joms COLLEGE utg
(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
Customer borows Loan In this part of ER diagram, "has" s the relationship between customer
and locker entities.
iv)
Loan
K Paymen
DeponikamCeposik da Student
aynent a PaymentLno)Payment date
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.
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
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)