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

Unit 1 (Introduction & ER Model)

Uploaded by

Madhu Rayaprolu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Unit 1 (Introduction & ER Model)

Uploaded by

Madhu Rayaprolu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Database Management Systems UNIT-I

Introduction to Database Management System, Data Independence- Relation Systems and


Others, Database system architecture, Introduction- The Three Levels of Architecture-The
External Level- the Conceptual Level- the Internal Level- Mapping- the Database Administrator,
Various Data Models

The ER Model - The Relational Model, Relational Calculus, Introduction to Database Design,
Database Design and ER Diagrams-Entities Attributes, and Entity Sets-Relationship and
What
Relationship Sets - Conceptual Design is Database
with ER Model System
• A database system is basically a computerized record keeping system. i.e., it is a computerized system
whoseoverall purpose is to store information and to allow users to retrieve and update that information on
demand.
• A simplified picture of the database system is shown below.
• This system is a multi-user system in which many users can access the database at the same time.

• This system involves four major components.


1. Data,
2. hardware,
3. software and
4. users.
Data:
• The data in the database will be both integrated and shared.
• Integrated : Database is unification of several distinct files, with any redundancies among these files will
be partly or wholly removed.
• Shared : The database can be shared among different users.

Hardware:
• The hardware components of the system include disk, CPU, main memory etc.

Software:
• Between the physical database and the user is a layer of software, known as Database Management
System(DBMS)
• DBMS handles all requests for access to the database.
• Functions of DBMS:
o Shields the database users from hardware level details.
o Data Dictionary Management
o Data Storage Management
o Data Transformation and Presentation
o Security Management

Department of CSE, Vishnu Institute of Technology 1


Database Management Systems UNIT-I
o Backup and Recovery Management
o Data Integrity Management
o Transaction Management
Users:
• For small databases typically one person defines, construct, and manipulates the data.
But for largeorganizations, many people will be involved.
• There are various types of users based on the level of access and how much
permission he has toalter/modify/or to any other operation on the database

Different types of users are


1. Application programmers
• Application Programmers are responsible for writing application programs that use the database.
These programs could be written in General Purpose Programming languages such as Visual Basic,
Developer, C, FORTRAN, COBOL etc. to manipulate the database. These application programs
operate on the data to perform various operations such as retaining information, creating new
information, deleting or changing existing information.
2. End users
• The database primarily exists for their use.
• End users are those whose jobs require access to the database for querying, updating, and
generatingreports.
• There are several categories of end users:
• Casual end users : Needs different information each time. They use a sophisticated database query
interface to specify their requests.
• Naive users : Any user who does not have any knowledge about database can be in this
category.There task is to just use the developed application and get the desired results. For
example: Clerical
staff in any bank is a naïve user. They don’t have any dbms knowledge but they still use the
database and perform their given task.
• Sophisticated end users : include engineers, scientists, business analysts, and others who
thoroughly familiarize themselves with facilities of the DBMS
3. Database Designers:
• Responsible for identifying the data to be stored in the database and for choosing appropriate
structures to represent and store this data.
• Understands the requirements of the user. The design should be capable of supporting the
requirements of all user groups.
4. Database administrator (DBA)
• The function of managing and maintaining database management systems (DBMS)
software
• He is the chief administrator to oversee and manage the resources.
• The primary resource is the database itself and the secondary resource is the DBMS
and the related softwares.
• Various responsibilities of DBA are
1. Policy formulation and implementation
a) Access privileges - users should access the database only in ways in which they are entitled.
b) Security - Access restrictions ensure that the database is secure. Passwords, encryption,
and views implement security. Effective password protection is important.
c) Disaster Planning – Databases can be harmed from hardware and software malfunctions,
and outside forces like floods and power outages. DBA’s must take active role in
formulating disaster recovery plans.
d) Archives – An archive is a place where corporate data is kept. Information in an archive is
removed from the database and stored in the archive for future reference. Archives are
usually kept in a mass-storage device like a disk, tape, CD, or a DVD. It is important such
archives be kept off-site to allow recovery should disaster strike
Department of CSE, Vishnu Institute of Technology 2
Database Management Systems UNIT-I

2. Data Dictionary management


i. Data Dictionary is like a catalog, it contains a wider range of information, including
informationon tables, fields, indexes, and programs.
ii. The DBA manages and updates the data dictionary, which establishes naming conventions
fortables, fields etc., and data integrity rules.
3. Training
i. DBAgives training on the DBMS and how to access the database.
4. DBMS support
a) The DBA is charged with all aspects of a DBMS, including selection and management.
5. Database Design
i. DBA is responsible for tuning the design, i.e., making changes that improve system
performance
Functions of DBA in simple terms
• Authorizing access to the database
• Coordinating and monitoring its use.
• Acquiring hardware and software resources as needed.
• Accountable for problems such as security breaches and poor system response time.
• Defining external/internal/conceptual schema
• Relationship with users
• Defining security and integrity checks
• Defining Backup and recovery procedures
• Monitoring performance and changing requirements.

What is a Database?
• A database is collection of related data
• Def: A database is a collection of persistent data that is used by the application systems of some given
enterprise.
o Database is persistent because once it has been accepted by the DBMS for entry, it can
subsequentlybe removed from the database only by some explicit request to the DBMS.
o Enterprise can be commercial, scientific, technical or other organization. It can be a single
individual ora complete corporation.

• A real world scenario will be translated into a database. It is combination of entities, relationships and
properties.
• Entity is any real world object w.r.t our problem domain. It is an object about which we wish to
recordinformation.
• An entity set is a set of that share common properties of entities
• A relationship is an association among two or more entities or other relationships.
• The properties/attributes are the information we want to record about entities.
• Properties can be either simple or complex.

Data and Data Model:


• A data model is a model of the persistent data of some particular enterprise.
• Data models are collection of conceptual tools used to describe data, data relationships and
consistencyconstraints.
• Data models are used to describe data stored in database.
• A data model is an abstract, self-contained logical definition of the objects, operators that constitute the
abstract machine with which user interacts.
• The objects allow us to model the structure of the data.
• The operators allow us to model its behaviour
• An implementation of the given model is a physical realization on a real machine.

Department of CSE, Vishnu Institute of Technology 3


Database Management Systems UNIT-I

• Model – is what users have to know about


• Implementation – is what users do not have to know about.
• There are number of data models.

The various data models are


• ER model
• Relational model
• Object based data model
• Network data model
• Hierarchical data model.

• The DBMS and database must adhere to a data model.

• Relational model proposed by Codd (Codd, 1970)


o Everything is a relation
o Query consists of algebraic composition of a few powerful operators
o Equivalent to first-order relational calculus
o Because of its simplicity, it found many supporters (specially at universities)

Why database?
• A database is a collection of data or information which is held together in an organised or logical way.
• Databases can either be paper based or computerised.

The advantages of database system over traditional paper-based methods of record keeping are
1. Compactness : There is no need for paper files which are big at volume.
2. Speed : machine retrieves and updates data faster than machine.
3. Less drudgery : mechanical works like maintaining files by hand is eliminated.
4. accurate : Accurate, up-to-date information is available on demand at anytime.
5. Protection : Database can be better protected against unintentional loss & lawful access.
6. Multi-user environment can be provided.

Computerised databases can either use a File management System or Database Management system.

File Management Systems:


• Before the advent of DBMS, data used to be managed by File processing system. In this data is stored in
operating system files.
• This system needs number of application program to allow user to manipulate the information.
• Keeping information in a file processing system has a number of major disadvantages.

They are
1. Data redundancy and inconsistency : Redundancy means multiple copies of the same data. To access data
different programmers create files with different structures in different programming languages. It leads to
data duplication.
Eg: If the student address is stored in several files , and we change only one copy then it leads to data
inconsistency.
Data inconsistency means, multiple copies of the same data may no longer agree.
2. Difficulty in accessing the data: FPS doesn’t allow required data to be retrieved in a convenient and
efficient manner.
Eg: if a user asks a list of customers living in a particular town then they have to write a program manually,
which is a tedious job.
3. Data isolation: New application is needed to retrieve data, as data scatters in multiple files, which has
different formats. Writing new applications every time is a difficult task.

Department of CSE, Vishnu Institute of Technology 4


Database Management Systems UNIT-I

4. Integrity problems : Data stored in the system has to satisfy certain consistency
constraints.Eg: minimum balance of an account be Rs.500/-
We say that data is maintaining integrity, when all these conditions are met.
In FPS, when new constraints are added, it is difficult to change the programs to enforce them.
5. Atomicity Problems : Atomicity means either all actions of a program should be executed, or none of
theactions should be executed.
Eg: A fund transfer of Rs. 500/- from Account A to B
A B
Assume the initial balances 1000 2000
A B
If all actions are done 500 2500
A B
If none of them are done 1000 2000
A B
But partial execution of operations is not acceptable 500 2000
It is difficult to ensure atomicity in FPS.

6. Concurrent access anomalies : When many programs are executed simultaneously, sometimes anomalies
maycome. Dealing these anomalies is difficult case of FPS.
7. Security Problems : Security can be provided by keeping passwords to files. But this is not sufficient when
we have to allow users to access different subsets of the data.

These problems of FPS prompted the development of database systems. A DBMS is a piece of software designed to
make the preceding tasks easier.

Benefits of the Database Approach:


1. Data Independence : The DBMS provides an abstract view of data that hides data representation and
storagedetails from application programs.
2. Efficient data access : DBMS uses good techniques to store and retrieve data efficiently.
3. The data can be shared : Existing applications can share the data in the database and also new applications can
be developed to operate on the same data.
4. Redundancy can be reduced : Every application in non-database system has its own private files, which leads to
redundancy in stored data. This redundancy wastes the storage and causes inconsistencies. It can be eliminated
in database systems as there is centralized control of data.
5. Inconsistency can be avoided (to some extent) : Data is said to be inconsistent if the duplicate entries will not
agree. When one of the two entries is updated and other not then the database is said to be inconsistent state.
Inconsistency can be avoided by representing the fact by a single entry in databases.
6. Transaction support can be provided : A transaction is a logical unit of work, typically involving several
database operations. Atomicity can be achieved by transaction support.
7. Integrity can be maintained : DBMS can enforce integrity constraints easily. For eg: before inserting salary
information for an employee, the DBMS can check that the department budget is not exceeded.
8. Security can be enforced : Ensuring access to the database through proper channel is possible in DBMS. DBA
defines security constraints to be checked whenever access is attempted to sensitive data.
9. Concurrent access and crash recovery : A DBMS provides concurrent access to the data in such a manner that
users can think of the data as being accessed by only one user at a time.
10. Reduced Application Development Time: As DBMS supports important functions common to many
applications, developing new applications can be done in reduced time.

Department of CSE, Vishnu Institute of Technology 5


Database Management Systems UNIT-I
Types of DBMS Architecture:

1. Single Tier Architecture

Single Tier DBMS Architecture is the most straightforward DBMS architecture. All the DBMS
components reside on a single server or platform, i.e., the database is directly accessible by
the end-user. Because of this direct connection, the DBMS provides a rapid response, due to
which programmers widely use this architecture to enhance the local application.

In this structure, any modifications done by the client are reflected directly in the database, and
all the processing is done on a single server. Also, no network connection is required to perform
actions on the database. This database management system is also known as the local database system.

2. Two Tier Architecture


The application is partitioned into a component that resides at the client machine,
which invokes database system functionality at the server machine through query
language statements. Application program interface standards like ODBC and JDBC are
used for interaction between the client and the server.
• It provides added security to the DBMS as it is not exposed to the end-user
directly.
• It also provides direct and faster communication.

3. Three Tier Architecture


The client machine acts as merely a front end and does not contain any direct database calls. Instead, the client
end communicates with an application server, usually through
a forms interface. The application server in turn communicates
with a database system to access data. The business logic of
the application, which says what actions to carry out under
what conditions, is embedded in the application server,
instead of being distributed across multiple clients. Three-tier
applications are more appropriate for large applications, and
for applications that run on the World Wide Web.

Department of CSE, Vishnu Institute of Technology 6


Database Management Systems UNIT-I

The three levels of the Architecture


Data Abstraction:
• Abstraction means hiding the complexity and providing only necessary details. Data
Abstraction hides theirrelevant details from the users.
• Database system comprises of complex data structures. Developers use abstraction in
order to
o Make the system efficient in terms of retrieval of data
o Reduce complexity in terms of usability of users.
• This approach simplifies the database design.
• DBMS provides an abstract view of the data stored in the database i.e., the system hides certain details of
howthe data are stored and maintained. To retrieve data efficiently, DBMS uses complex data structures.
Since many database users are not computer trained, developers hide the complexity from users through
several levels of abstraction.
• The Data in a DBMS is described at three levels of abstraction.
• The database description consists of a schema at each of these three levels of abstraction. They are
o Conceptual schema
o Physical schema
o External schema
• Levels of abstraction are shown in below figure.

• Conceptual schema (logical schema) describes the stored data interms of the data model of the DBMS.
• Physical schema specifies storage details
• External schema allows access to individual users or group of users.

Architecture of DBMS
The Architecture of most of commercial DBMS available today is mostly based on this ANSI-SPARC1 database
architecture.
The objectives of this three-level architecture is to separate the user's view,
• It allows independent customized user views: Each user should be able to access the same data, but have a
different customized view of the data. These should be independent: changes to one view should not affect
others.
• It hides the physical storage details from users: Users should not have to deal with physical database
storage details.
• The database administrator should be able to change the database storage structures without affecting the
users’ views.
• The internal structure of the database should be unaffected by changes to the physical aspects of the
storage: For example, a changeover to a new disk.
1
ANSI-SPARC stands for American National Standards Institute, Standards Planning And Requirements Committee, is an
abstract design standard for a Database Management System (DBMS)

Department of CSE, Vishnu Institute of Technology 7


Database Management Systems UNIT-I

ANSI SPARC architecture has three main levels:


• Internal Level
• Conceptual Level
• External Level

• These three levels provide data abstraction, that means they hide the low level complexities from end users .
• Using these three levels, it is possible to use complex structures at internal level for efficient operations
andto provide simpler convenient interface at external level.
• The detailed database architecture is shown in the below figure.

The External Level :


• It is the highest level of abstraction, and it describes only part of the entire database.
• This level is the individual user level, closest to the user. It is concerned with the way the data is seen
by individual users.
• This level exists to ease the accessibility of the database by an individual user.
• It excludes irrelevant data as well as data which the user is not authorised to access.
• Users can be an application programmer, or an end user of any degree of sophistication. The programmer
mayuse either a conventional or proprietary programming language like C, C++, Java, Python. Other users
can use either a query language or some special purpose language tailored to that users requirement.
• Even though the conceptual level (logical level) uses simpler structures, complexity remains, as it describes
theentire data in the database. The view level describes the portion of the data (stored in the database)
relevant to the user.
• The system provides many views for the same database.

Department of CSE, Vishnu Institute of Technology 8


Database Management Systems UNIT-I

• Any database will have only one conceptual and physical schema, but it may have more number of
external schemas, each tailored to a particular group of users.
• External Schema is a collection of one or more views and relations from the conceptual schema. By
concept aview is a relation, but it is not stored in the DBMS.
• External Schema design is guided by end user requirement

The Conceptual Level:


• The conceptual level is a way of describing what data is stored within the whole database and how the
data is inter-related. The conceptual level does not specify how the data is physically stored.
• It is a level of indirection between the other two.
• It is also referred as logical level.
• This level describes data using relatively simple structures. It describes the stored data in terms of the data
model of the DBMS.
• DBA uses logical level of abstraction.
• It gives global view of database.
• It is Independent of hardware and software
• This schema defines all the logical constraints that need to be applied on the data stored.
• It defines tables, views, integrity constraints etc.
• The process of arriving at a good conceptual schema is called conceptual database design.

The Internal Level:


• The lowest level of abstraction describes how the data is actually stored in the memory.
• This level is closest to the physical storage.
• It is also referred as storage level
• It is concerned with the way the data is stored inside the system.
• This level describes complex low-level data structures in detail.
• Here the data structures to store the relations are decided based on the access methods like
sequential/random and file organization methods like B+ trees, hashing for sorting etc.
• Decision about the physical schema is based on an understanding of how the data is typically accessed.
The process of arriving at a good physical schema is called Physical Database Design.

Advantages of Three Tier DBMS Architecture are:


 Scalability - Since the database server isn't aware of any users beyond the application layer and the
application layer implements load balancing, there can be as many clients as you want.
 Data Integrity - Data corruption and bad requests can be avoided because of the checks performed in the
application layer on each client request.
 Security - The removal of the direct connection between the client and server systems via abstraction reduces
unauthorized access to the database.

Data Independence :
• The main benefit of DBMS is it offers data independence i.e., the
application programs are insulated from changes in the way the data is
structured and stored and this is achieved through the use of the three
levels ofabstraction.
• The main purpose of data abstraction is achieving data independence
in order to save time and cost requiredwhen the database is modified
or altered.

• We have namely two levels of data independence arising from these


levels of abstraction :
1. Physical data independence
2. Logical data independence
Department of CSE, Vishnu Institute of Technology 9
Database Management Systems UNIT-I

Physical level data independence :


• Application programs are not affected by changes in physical schema is called physical data independence.
• It refers to the characteristic of being able to modify the physical schema without any alterations to
theconceptual or logical schema, done for optimisation purposes,
• e.g., Conceptual structure of the database would not be affected by any change in storage size of the
databasesystem server. Changing from sequential to random access files is one such example.
• These alterations or modifications to the physical structure may include:
o Utilising new storage devices.
o Modifying data structures used for storage.
o Altering indexes or using alternative file organisation techniques etc.

Logical level data independence:


• It refers characteristic of being able to modify the logical schema without affecting the external schema
orapplication program.
• The user view of the data would not be affected by any changes to the conceptual view of the data.
• These changes may include insertion or deletion of attributes, altering table structures entities or
relationshipsto the logical schema etc.

Mappings:
• In addition to the levels, architecture also involves mappings.
o One conceptual / internal mapping
o Several external / conceptual mappings

The conceptual / internal mapping:


• It defines the correspondence between the conceptual view and the stored database.
• It specifies how the records and fields at conceptual level are represented in the internal level.
• This mapping has to be changed whenever the structure of database is changed.
• It is the responsibility of the DBA and the underlying DBMS.
• Physical data independence is preserved through this mapping.

An External / Conceptual Mapping:


• It defines the correspondence between a particular external view and the conceptual view.

Properties of Database
• Data sharing
• Data Integration
• Data Integrity
• Data Security
• Data Abstraction
• Data Independence

Types of Data Models:

Department of CSE, Vishnu Institute of Technology 10


Database Management Systems UNIT-I
Hierarchical Model : The hierarchical data model is one of the oldest data
models, developed in the 1950s by IBM. In this data model, the data is
organized in a hierarchical tree-like structure. This data model can be easily
visualized because each record has one parent and many children (possibly
0) as shown in the image given below.

The above given image represents the data model of the Vehicle database,
vehicle are classified into two types Viz. two-wheelers and four-wheelers
and then they are further classified. The main drawback we can see here is
we can only have one to many relationships under this model, hence the
hierarchical data model is very rarely used nowadays.

Network Model : A network model is nothing but a generalization of the hierarchical data model as this data model
allows many to many relationships therefore in this model a record can also have more than one parent.
The network model can be represented as a graph and hence it replaces
the hierarchical tree with a graph in which object types are the nodes and
relationships are the edges.
For example -
Here you can see all the three departments are linked with the director
which was not possible in the hierarchical data model. In the network
model, there can be many possible paths to reach a node from the root
node (College is the root node in the above case), therefore the data can
be accessed efficiently when compared to the hierarchical data model.
But, on the other hand, the process of insertion and deletion of data is
quite complex.

Entity-Relationship model (ER Model) : An Entity-Relationship model is a high-level data model that describes the
structure of the database in a pictorial form which is known as ER-diagram. In simple words, an ER diagram are used to
represent logical structure of the database easily. ER model develops a conceptual view of the data hence it can be
used as a blueprint to implement the database in the future. Developers can easily understand the system just by
looking at ER diagram. Let's first have a look at the components of an ER
diagram.

 Entity - Anything that has an independent existence about which we


collect the data. They are represented as rectangles in the ER
diagram. For example - Car, house, employee.
 Entity Set - A set of the same type of entities is known as an entity set.
For example - Set of students studying in a college.
 Attributes - Properties that define entities are called attributes. They
are represented by an ellipse shape.
 Relationships - A relationship is used to describe the association
between entities. They are represented as diamond or rhombus shapes
in the ER diagram.

In the above-represented ER diagram, we have two entities that are Employee and Company and the relationship
among them. Also, in the above-represented ER diagram, we can see that both employee and company have some
attributes and the relationship is of "works in" type, which means employee works in a company.

Department of CSE, Vishnu Institute of Technology 11


Database Management Systems UNIT-I
Relational Model: This is the most widely accepted data model. In this model, the database is represented as
a collection of relations in the form of rows and columns of a two-dimensional table. Each row is known as
a tuple (a tuple contains all the data for an individual record) while each column represents an attribute. For
example –
Stu. Id Name Branch
101 Naman CSE
102 Saloni ECE
103 Rishabh IT
104 Pulkit ME

The above table shows a relation "STUDENT" with attributes as Stu. Id, Name, and Branch which consists of 4 records
or tuples.

Object-Oriented Data model: As suggested by its name, the object-oriented data model is a combination of object
oriented programming, and relational data model. In this data model, the data and their relationship are
represented in a single structure which is known as an object. Since data is stored as objects we can easily
store audio, video, images, etc in the database which was very
difficult and inconvenient to do in the relational model. As shown in
the image below two objects are connected with each other through
links.

In the image, we have two objects that are Employee and


Department in which all the data is contained in a single unit (object).
They are linked with each other as they share a common
attribute i.e.i.e. Department_Id.

Object Relational Data Model : Again as suggested by its


name, the object-relational data model is an integration of the
object oriented model and the relational model. Since it inherits
properties from both of the models it supports objects, classes,
etc like object oriented model and tabular structures like the
relational model. For example -
It provides data structures and operations used in the
relational model and also provides features of object oriented
models like classes, inheritance, etc. The only drawback of this
data model is that it is complex and quite difficult to handle.

Advantages of Data Models


 Data models ensure that the data is represented accurately.
 The relationship between the data is well defined.
 Data redundancy can be minimized and missing data can be identified easily.
 Last but not the least, security of the data is not compromised.

Disadvantages of Data Models


 The biggest disadvantage of the data model is, one must know the characteristics of physical data to build a
data model.
 Sometimes in big databases, it is quite difficult to understand the data model also the cost incurred is very
high.

Department of CSE, Vishnu Institute of Technology 12


Database Management Systems UNIT-I
Applications of DBMS
Database is widely used. The some of the representative applications are:
1. Banking: for customer information, accounts and loans and banking
transactions.
2. Universities: for student registrations and grades.
3. Online shopping: Everyone wants to shop from home. Everyday new
products are added and sold only with the help of DBMS. Purchase
information, invoice bills and payment, all of these are done with the help of
DBMS.
4. Airlines: for reservations and schedule information.
5. Credit card transactions : for purchases on credit cards and generation of
monthly statements.
6. Library Management System: maintain all the information relate to book issue dates, name of the
book,author and availability of the book.
7. Telecommunications: for keeping records of call made, generating monthly bills, maintaining balances
onprepaid calling cards.
8. Sales: for customer, product and purchase information.
9. Finance: for storing information about holdings, sales, and purchases of financial instruments such as
stocks and bonds.
10. Manufacturing: for management of supply chain and for tracking production of items in factories,
inventoriesof items and orders for items.
11. Human Resource: for information about employees, salaries, payroll taxes and benefits.

Advantages of DBMS
1. Controlling of Redundancy: Data redundancy refers to the duplication of data (i.e storing same data
multiple times). In a database system, by having a centralized database and centralized control of data by
the DBA the unnecessary duplication of data is avoided. It also eliminates the extra time for processing the
large volume of data. It results in saving the storage space.
2. Improved Data Sharing: DBMS allows a user to share the data in any number of application programs.
3. Data Integrity: Integrity means that the data in the database is accurate. Centralized control of the data
helps in permitting the administrator to define integrity constraints to the data in the database. For
example: in customer database we can enforce an integrity that it must accept the customer only from
Noida and Meerut city.
4. Security: Having complete authority over the operational data, enables the DBA in ensuring that the only
mean of access to the database is through proper channels. The DBA can define authorization checks to be
carried out whenever access to sensitive data is attempted.
5. Data Consistency: By eliminating data redundancy, we greatly reduce the opportunities for inconsistency.
For example: is a customer address is stored only once, we cannot have disagreement on the stored values.
Also updating data values is greatly simplified when each value is stored in one place only. Finally, we avoid
the wasted storage that results from redundant data storage.
6. Efficient Data Access: In a database system, the data is managed by the DBMS and all access to the data is
through the DBMS providing a key to effective data processing
7. Enforcements of Standards: With the centralized of data, DBA can establish and enforce the data
standards which may include the naming conventions, data quality standards etc.
8. Data Independence: Ina database system, the database management system provides the interface
between the application programs and the data. When changes are made to the data representation, the
meta data obtained by the DBMS is changed but the DBMS is continues to provide the data to application
program in the previously used way. The DBMs handles the task of transformation of data wherever
necessary.
9. Reduced Application Development and Maintenance Time : DBMS supports many important functions
that are common to many applications, accessing data stored in the DBMS, which facilitates the quick
development of application.

Department of CSE, Vishnu Institute of Technology 13


Database Management Systems UNIT-I
Disadvantages of DBMS
1. Increased Complexity
2. Requirement of New and Specialized Manpower
3. Large Size of DBMS
Important Questions

1. What is the need of data model in DBMS and give its classification
2. Who are the different database users? Explain their interfaces to database management system.
3. Describe the client server architecture for the database with necessary diagram.
4. Define Database Management Systems.
5. What is Data Base Administrator? Discuss the functions of DBA.
6. Explain DBMS applications
7. What are the disadvantages in file system?
8. What is data independence? Discuss three tire schema architecture of data independence.
9. Explain storage manager component.
10. Explain object-oriented data model.
11. Explain briefly the languages supported by database systems.
12. What is Data modeling? Explain relational model.
13. List various types of database users. Explain.
14. Discuss abstract view of data with diagram.
15. Explain about Entity-Relationship model with an example.
16. Define the two levels of data independence.
17. Explain the merits and demerits of data base system.
18. Differentiate between schema and instance.
19. Describe the characteristics of a database system.
20. Draw and explain three-tier schema architecture of database system.
21. Present any two database applications by describing their features.
22. What do you mean by environment in database systems? Explain with the help of database system
structures.
23. Mention various groups of database users. Explain about their roles in detail.
24. What is a data model? Describe various data models.
25. Distinguish between centralized and client-server architectures of a database system.
26. Differentiate between File system and Database System
27. List out Database applications.
28. Explain in detail about Database Management System advantages over file management system.
29. Explain the concept of Data independence.
30. Briefly describe various architectures of database systems.
31. What is Data Independence? Why is it essential?

Relation Algebra and Calculus


• These are formal query languages associated with the relational model.
• Query Languages are specialized languages for asking questions / queries that involve data in the database.
• Queries in Relational algebra (RA) are composed using a collection of operators. Each query describes a step
bystep procedure for computing the desired answer.
• Query in Relational Calculus describes the desired answer without specifying how the answer is
computed. This is non-procedural and this style of querying is called declarative.
• These formal query languages greatly influenced commercial query languages such as SQL.

Sample Queries are presented using the following Schema


Sailors ( sid : integer, sname : string, rating : integer )
Boats ( bid : integer, bname : string, color : string )
Reserves ( sid : integer, bid : integer, day : date )

Department of CSE, Vishnu Institute of Technology 14


Database Management Systems UNIT-I

Instance S1 of Sailors Instance S2 of Sailors Instance R1 of Reserves


sid sname rating age sid sname rating age E bid day
22 Dustin 7 45.0 28 Yuppy 9 35.0 22 101 10/10/96
31 Lubber 8 55.5 31 Lubber 8 55.5 58 103 11/12/96
58 Rusty 10 35.0 44 Guppy 5 35.0
58 Rusty 10 35.0

Relational Calculus:
• It is an alternative to Relational Algebra.
• It allows us to describe the set of answers without being explicit about how they should be computed. i.e.,
it isa non-procedural language. It can also be called as declarative language.
• Calculus has variables, constants, comparison operators, logical connectives and quantifiers
• Relational calculus comes in two flavours
o Tuple Relational Calculus (TRC)
o Domain Relational Calculus (DRC)
• Both TRC and DRC are simple subsets of first-order logic.
• Expressions in the calculus are called formulas. An answer tuple is essentially an assignment of constants
tovariables that make the formula evaluate to true.

Tuple Relational Calculus:


• In TRC, variables range over tuples. i..e, variables in TRC take on tuples as values.
• A tuple variable is a variable that takes on tuples of a particular relation schema as values.
• It has more influence on SQL.
• A TRC query has the form
{ T | P(T) }
Where T is a tuple variable.
P(T) denotes a formula that describes T.

• Result of { T | P(T) } this query is the set of all tuples t which the formula P(T) evaluates to true.

Ex: Find all sailors with a rating above 7.


{S |S ∈ Sailors ⋀ s. rating > 7 }

Syntax of TRC queries:


Let Rel be a relation name,R and S be tuple variables,
a be an attribute of R, and b be an attribute of S,
let op denotes a relational operator.
An atomic formula is one of the following:
• R ∈ Rel
• R. a op S. b
• R. a op Constant
A formula is recursively defined to be one of the following, where P and Q are themselves formulas and P(R)
denotes aformula in which the variable R appears.

• The quantifiers are said to bind the variable.


• A variable is said to be free in a formula if the formula does not contain an occurrence of a quantifier
Department of CSE, Vishnu Institute of Technology 15
Database Management Systems UNIT-I
that binds it.
• A TRC query is defined to be an expression of the form {T | P(T)}, where T is the only free variable in
theformula P.

Examples :
1. Find the names and ages of sailors with a rating above 7.
{P | S  Sailors(S.rating > 7  P.name = S.sname  P.age = S.age)}

This query illustrates a useful convention: P is considered to be a tuple variable with exactly two fields, which
are called name and age, because these are the only fields of P that are mentioned and P does not range
over any of the relations in the query; that is, there is no subformula of the form P  Relname. The result of
this query is a relation with two fields, name and age. The atomic formulas P.name = S.sname and P.age =
S.age give values to the fields of an answer tuple P . On instances B1, R2, and S3, the answer is the set of
tuples 〈Lubber, 55.5〉, 〈Andy, 25.5〉, 〈Rusty, 35.0〉, 〈Zorba, 16.0〉, and 〈Horatio,35.0〉.

2. Find the sailor name, boat id and reservation date for each reservation.
{P | R Reserves S  Sailors
(R.sid = S.sid 
P.bid = R.bid 
P.day = R.day 
P.sname = S.sname)}
For each Reserves tuple, we look for a tuple in Sailors with the same sid. Given a pair of such tuples, we
construct an answer tuple P with fields sname, bid, and day bycopying the corresponding fields from these
two tuples. This query illustrates how we can combine values from different relations in each answer tuple.

3. Find the names of sailors who have reserved boat 103.


{P | S  Sailors R  Reserves(
R.sid = S.sid 
R.bid = 103 
P.sname = S.sname)}
This query can be read as follows: “Retrieve all sailor tuples for which there exists a tuple in Reserves, having
the same value in the sid field, andwith bid = 103.” That is, for each sailor tuple, we look for a tuple in
Reserves that shows that this sailor has reserved boat 103. The answer tuple P contains just one field, sname

4. Find the names of sailors who have reserved a red boat.


{P | S  Sailors R  Reserves(
R.sid = S.sid 
P.sname =S.sname 
B Boats(
B.bid = R.bid 
B.color = ’red’))}
This query can be read as follows: Retrieve all sailor tuples S for which there exist tuples R in Reserves and B
in Boats such that S.sid = R.sid, R.bid = B.bid, and B.color = ‘red’.

5. Find the names of sailors who have reserved at least two boats.
{P | S  Sailors R1  Reserves R2  Reserves (S.sid = R1.sid 
R1.sid = R2.sid 
R1.bid ≠ R2.bid 
P.sname = S.sname)}

Department of CSE, Vishnu Institute of Technology 16


Database Management Systems UNIT-I
6. Find the names of sailors who have reserved all boats.
{P | S  Sailors B  Boats
(R  Reserves(
S.sid = R.sid 
R.bid = B.bid 
P.sname = S.sname))}
This query was expressed using the division operator in relational algebra. Notice how easily it is expressed in
the calculus. The calculus query directly reflects how we might express the query in English: “Find sailors S
such that for all boats B there is a Reserves tuple showing that sailor S has reserved boat B.”

7. Find sailors who have reserved all red boats.


{S | S  Sailors  B  Boats(
B.color =’red’ (R ∈ Reserves(
S.sid = R.sid 
R.bid = B.bid)))}
This query can be read as follows: For each candidate (sailor), if a boat is red, the sailor must have reserved
it. That is, for a candidate sailor, a boat being red must imply the sailor having reserved it. Observe that since
we can return an entire sailor tuple as the answer instead of just the sailor’s name, we have avoided
introducing a new free variable.

We can write this query without using implication, by observing that an expression of the form p q is
logically equivalent to ¬p ^ q:
{S | S  Sailors B  Boats
(B.color ≠’red’  (R  Reserves(
S.sid = R.sid 
R.bid = B.bid)))}
This query should be read as follows: “Find sailors S such that for all boats B, either the boat is not red or a
Reserves tuple shows that sailor S has reserved boat B.”

Domain Relational Calculus:


• A domain variable is a variable that ranges over the values in the domain of some attribute.
• Form of a DRC query.
{<x1, x2, ..., xn> | P(<x1, x2, ..., xn>)}
Each xi is a domain variable.
P(<x1, x2, ..., xn>) denotes a DRC formula.

• The result of this query is the set of all tuples <x1, x2, ..., xn> for which the formula evaluates to true.

• DRC formula is similar to TRC formula DRC formula:

Department of CSE, Vishnu Institute of Technology 17


Database Management Systems UNIT-I
Examples :
1. Find the sailors with a rating above 7.

2. Find the names of sailors who have reserved boat 103.

(or)

3. Find the names of sailors who have reserved at least two boats.
{〈N 〉| I, T, A(〈I, N, T, A〉  Sailors 
Br1, Br2, D1, D2(I, Br1, D1〉  Reserves 
〈I, Br2,D2 〉 Reserves  Br1 = Br2)

4. Find the names of sailors who have reserved all boats.

5. Find sailors who have reserved all red boats.

Database Design
Database Design process is divided into 6 basic steps.
1. Requirements Analysis
2. Conceptual Database Design
3. Logical Database Design
4. Schema Refinement
5. Physical Database Design
6. Application and Security Design.

1. Requirements Analysis
• This is the first step in designing any database application.
• This is an informal process that involves
o Discussion with users,
o Study of current environment and its changes
o Analysis of documentation on existing applications.

• Under this, we have to understand the following.


o What data is to be stored in a database?
o What applications must be built on top of the database?
o What users want from the database?

• Example: For customer database, data is cust-name, cust-city, and cust-no.

Department of CSE, Vishnu Institute of Technology 18


Database Management Systems UNIT-I
• There are several methods today to organize and present the information gathered in requirements analysis.

2. Conceptual Database Design


• The information gathered in the requirements analysis step is used to develop a higher-level description
andconstraints of the data.
• This phase is carried out by ER model.
• The goal here is to create a simple description of data that closely matches how users and developers
think ofdata.
• Characteristics of this phase are as below.
1. Expressiveness: The data model should be expressive to distinguish different types of data,
relationships and constraints.
2. Simplicity and Understandability : The model should be simple to understand the concepts.
3. Minimality: The model should have small number of basic concepts.
4. Diagrammatic Representation: The model should have a diagrammatic notation for displaying
the conceptual schema.
5. Formality: A conceptual schema expressed in the data model must represent a formal specification of
thedata.
• Example: Cust_name : string;
Cust_no : integer;
Cust_city : string;

3. Logical Database Design :


• Under this, we must choose a DBMS to implement our database design and convert the conceptual
databasedesign into a database schema.
• The choice of DBMS is governed by number of factors as below.
1. Economic Factors.
2. Organizational Factors.
• As we are considering relational DBMS, here we convert ER diagram into a relational database schema.

4. Schema Refinement :
• Under this, we have to analyze the collection of relations in our relational database schema to identify
thepotential problems.

5. Physical Database Design


• Physical database design is the process of choosing specific storage structures and access paths
forthe database files to achieve good performance for the various database applications.
• This step involves building indexes on some tables and clustering some tables.
• The physical database design can have the following options.
1. Response Time: This is the elapsed time between submitting a database transaction for execution
andreceiving a response.
2. Space Utilization: This is the amount of storage space used by the database files and their
access pathstructures on disk including indexes and other access paths.
3. Transaction Throughput: This is the average number of transactions that can be processed per minute.

6. Security Design:
• In this step, we must identify different user groups and different roles played by various users.
• For each role, and user group, we must identify the parts of the database that they must be able to access

Department of CSE, Vishnu Institute of Technology 19


Database Management Systems UNIT-I

A Simple diagram to show the main phases of database design

The Entity Relationship Model


• Data Model allows us to describe the data involved in a real world enterprise in terms of objects and
theirrelationships.
• ER Model is widely used to develop initial database design.
• It allows us to move from

informal description of a more detailed, precise


what users want from to description that can be
database implemented in a DBMS.

Entities, Attributes and Entity sets


The ER model describes data as entities, relationships, and attributes.

Entity :
• An entity is a thing or object in the real world with an independent existence.
• An entity may be an object
o with a physical existence (for example, a particular person, car, house, or employee) or
o it may be an object with a conceptual existence (for instance, a company, a job, or a university
course).
• Collection of similar entities is referred as Entity Set
o Eg: Faculty set
• Entity Sets need not be disjoint.
o Eg: A student who is part of CSE entity set may also be a part of CRT entity set.
• Entities are represented by Rectangle with entity name inside.

Department of CSE, Vishnu Institute of Technology 20


Database Management Systems UNIT-I

Attribute :
• Attributes are particular properties that describe the entity.
• All entities in a given entity set have the same attributes.
o Eg: Attributes of Employee entity set are empno, name, salary .
• It is represented by an oval.

• The attribute value that describes it becomes major part of the data stored in the Database.

• Domain is set of possible values for an attribute. For every attribute of an entity set, we must
identify adomain.
o Eg: employee name is set of 50 character string.

• NULL values : sometimes a particular entity may not have an applicable value for an attribute or the value
is unknown. To handle these situations a special value NULL is used.
o Eg: Flat number in the address, college degree of a person(may or may not exist)

Several types of attributes occur in the ER model:


1. Simple Attributes 4. Multivalued Attributes 7. Key Attributes
2. Composite Attributes 5. Stored Attributes 8. Complex Attribute
3. Singlevalued Attributes 6. Derived Attributes
Simple Attribute :
o The attributes which cannot be further subdivided.
• Eg. Age, marital status, city etc.

Composite Attributes :
o The attributes which can be further divided into more attributes with independent meanings.
• Eg: Address can be further divided into street, city, state, country.
o The notation used is :

Single Valued Attribute:


• Attribute which has single value for a particular entity is single-valued attribute.
o Eg: age of a person.

Multivalued Attribute :
o Attributes which can have multiple values for a single entity.
• Eg: color of a car, phone number.
o These attributes are represented using a double lined oval.

Stored Attribute :
o Attributes that cannot be derived from other attributes.
• Eg: Birth_date

Department of CSE, Vishnu Institute of Technology 21


Database Management Systems UNIT-I
Derived Attribute:
o Attributes which are derived from other attributes.
o This can be derived from one or more attributes or from a separate table.
• Eg: age of a person (can be derived from DOB), experience of an employee, commission.
o These are represented using a dotted oval.

Complex Attributes:
o An attribute which is made by using the multivalued attributes and composite attributes.
• Eg: A person can have more than one residence; each residence can have more than one phone.

Key Attributes :
• The attribute which uniquely identifies each entity in the entity set is called key attribute.
• For example, Roll_No will be unique for each student.
• These attributes have unique values for all entities.
• In ER diagram, key attribute is represented by an oval with underlying line.

• Some entity sets have more than one key.


The complete entity type Student with its attributes can be represented as:

Relationships and Relationshipsets


• A relationship is an association among one or more entities.
o Eg: Karthika works in CSE department.
Karthika is an entity of Employee entity set, CSE is an entity of department entity set and works in
is the relation between these two entities.
• A relationship set is a collection of similar relationships
• It is a set of n tuples
{ (e1, … . , en) | e1 ∈ E1, … . , en ∈ En}
• Each tuple denotes a relationship involving N entities e1 through en, where entity ei is in the entity set Ei.
• An entity set can participate in several relationship sets.

Descriptive attributes: A relationship can have attributes which describes about the relation. These are
usedto record information about the relationship, rather than about any one of the participating entities.
o Eg: Latha works in CSE department since 01/01/15.
Department of CSE, Vishnu Institute of Technology 22
Database Management Systems UNIT-I

Eg: The works in relationship

• The relationships are identified the participating entities, not by descriptive attributes.
o i.e., in the above example relationship is identified by eid and did.

• An instance of a relationship set is a set of relationships. It can be thought of as a snapshot of relationship


set at some instant in time.

Degree of a relationship :
The number of different entity sets participating in the relationship set is the degree. It can be
o Unary relationship
o Binary relationship
o Ternary relationship
o N-ary relationship

Unary relationship :
• This is a relationship between the entities of the same entity set.
• The entity sets that participate in a relationship set need not be distinct.
o Eg: Latha reports to Sumit.
Both Latha and Sumit are entities of Employee Entity set, but they are playing different roles.
Here they are supervisor and subordinate.

Binary relationship :
• This is a relationship between any two different entities.
o Eg: The worksin relationship shown above is a binary relationship. Because the participating
entitiesare only two (Employee and Department)
Ternary Relationship:
• This is a relationship between any three different entities.
o Eg: Each department has offices in several locations. The ER diagram to record the locations at
which each employee works is

Department of CSE, Vishnu Institute of Technology 23


Database Management Systems UNIT-I
Cardinality of a relationship:
• The number of times an entity of an entity set participates in a relationship.
• Various cardinality ratios are
One entity from entity set A can be associated with at most one entity of entity set
Band vice versa.
It is marked as 1 : 1

one – to –
one

One entity from entity set A can be associated with more than one entities of entity
set B however an entity from entity set B, can be associated with at most one entity.
It is marked as 1 :N

one – to –
many

More than one entities from entity set A can be associated with at most one entity of
entity set B, however an entity from entity set B can be associated with more than
one entity from entity set A.
It is marked as N :1
many – to –
one

One entity from A can be associated with more than one entity from B and vice versa.
It is marked as M :N

many – to –
many

Participation Constraint:
• It specifies whether the existence of an entity depends on its being related to another entity via a
relationshiptype.
• This constraint specifies the minimum number of relationship instances that each entity can participate in.
• There are two types of participation constraints

Department of CSE, Vishnu Institute of Technology 24


Database Management Systems UNIT-I
1. Total participation
2. Partial participation

• Total Participation : Every entity in the entity set must be related to another entity in the relationship set.
o Eg: Every employee must work for a department.
In ER diagrams the total participation is represented by double line between participating entity
type torelationship.

• Partial Participation : Some part of the entityset is related to some other entity via a relationship.
o Eg: Few of the employee are managing the department.
In ER diagrams the total participation is represented by solid line between participating entity
type torelationship.

o Consider the relationship - Employee is head of the department. Here all employees will not be the
head of the department. Only one employee will be the head of the department. In other words,
only few instances of employee entity participate in the above relationship. So employee entity's
participation is partial in the said relationship. However each department will be headed by some
employee. So department entity's participation n is total in the said relationship.

Weak Entity Types :


• Weak Entity : Entity type that do not have key attributes of their own is called a Weak Entity.
• Strong / Regular Entity : Entity types that do have a key attribute.
• Entities of a weak entity type are identified by another entity types attribute value. That another entity
type isidentifying or owner identity type.
o Eg: employee

• As weak entities cannot be identified on their own, they always has a total participation w.r.t to its
identifyingrelationship.

• Partial Key : the attribute that can uniquely identify weak entities that are related to the same owner entity.
o Eg: pname (name of the dependent)

• In ER diagram, the weak entity types are represented by double lined rectangle.

• And identifying relationship is represented by double lined diamond.

• Partial key is underlined with a dashed or dotted line.

Department of CSE, Vishnu Institute of Technology 25


Database Management Systems UNIT-I

EER Model
• It is natural to classify the entities in an entity set into subclasses.
• EER model stands for Enhanced Entity Relationship Model.
• It includes all the modelling concepts of ER model and also the concepts of subclass and superclass and the
related concepts of specialization and generalization. The resultant diagrams are called Enhanced ER
diagrams.

• Specialization:
o Specialization is the process of identifying subsets of an entity set that share some
distinguishing characteristic.
o The entity type from which subclasses are defined is called superclass of specialization.
o Eg:
• set of classes Secretary, Technician, engineer are subclasses of superclass employee. This
distinguishing is on the basis of job type.
• Another specialization on employee based on method_of_pay can be hourly_employee
and salaried_employee.
• **we may have several specializations of the same entity type based on different distinguishing
characteristic**
• Attributes of subclass are called specific attributes.

• In the above ER diagram, two specialized entities were identified based on job type.

• Main reasons for including class/subclass relationships and specializations


1. Certain attributes may apply to some but not all entities of the superclass entity type. A subclass is
defined inorder to group the entities to which these attributes apply.
2. Some relationship types may be participated in only by entities that are members of the subclass.
3. We can add descriptive attributes that make sense only for the enetities in a subclass.

• Generalization:
o This is reverse process of abstraction.
o Generalization is the process of defining generalized entity type from the given entity types.
o Here we suppress the differences among several entity types, identify their common features,
andgeneralize them into a single super class.
o Eg: consider two entity types CAR and TRUCK

Department of CSE, Vishnu Institute of Technology 26


Database Management Systems UNIT-I

o From the above two entites a generalized entity can identified with the attributes vehicle_id,
licence_plate_no, price.

• Generalization is Bottom-Up approach and Specialization is Top-down approach.

• Aggregation:
o A relationship is an association between entitysets. But sometimes Database Designers may need to
model a relationship between a collection of entities and relationships.
o Aggregation is a feature, which allows us to indicate that a relationship participates in another
relationship.
o Eg: Each project entity is sponsored by one or more departments. Sponsors relationship captures this
information. The department that sponsors a project might assign employees to monitor the
sponsorship. Monitors is a relationship that is associated with sponsors relationship.
o We use aggregation, to express relationship among relationships.

Department of CSE, Vishnu Institute of Technology 27


Database Management Systems UNIT-I

Conceptual Design with ER Model


• ER modeling can get tricky!
• Design choices:
– Should a concept be modeled as an entity or an attribute?
– Should a concept be modeled as an entity or a relationship?
– Identifying relationships: Binary or ternary? Aggregation?
• Note constraints of the ER Model:
– A lot of data semantics can (and should) be captured.
– But some constraints cannot be captured in ER diagrams.
• We’ll refine things in our logical (relational) design

Entity vs. Attribute:


 Should address be an attribute of Employees or an entity (connected to Employees by a relationship)?
 Depends upon the use we want to make of address information, and the semantics of the data:
 If we have several addresses per employee, address must be an entity (since attributes cannot be
set-valued).
 If the structure (city, street, etc.) is important, e.g., we want to retrieve employees in a given city,
address must be modeled as an entity (since attribute values are atomic).

 Works_In2 does not allow an employee to work in a department for two or more periods.

 Similar to the problem of wanting to record several addresses for an employee: we want to record several
values of the descriptive attributes for each instance of this relationship.

Entity versus Relationship: There is at most one employee managing a department, but a given employee
could manage several departments; we store the starting date and discretionary budget for each manager-
department pair. This approach is natural if we assume that a manager receives a separate discretionary
budget for each department that he or she manages.

Department of CSE, Vishnu Institute of Technology 28


Database Management Systems UNIT-I

What if manager’s dbudget covers all managed depts? (can repeat value, but such redundancy is
problematic)

Advantages of ER Modeling
1. ER Modeling is simple and easily understandable. It is represented in business users language and it can be
understood by non-technical specialist.
2. Intuitive and helps in Physical Database creation.
3. Can be generalized and specialized based on needs.
4. Can help in database design.
5. Gives a higher level description of the system.

Disadvantages of ER Modeling
1. Physical design derived from E-R Model may have some amount of ambiguities or inconsistency.
2. Sometime diagrams may lead to misinterpretations

Example:
 ER Diagram of a company

Department of CSE, Vishnu Institute of Technology 29


Database Management Systems UNIT-I
 ER-Diagram on University

 ER-Diagram on Hospital

Important Questions
1. How to represent a weak entity set in ER diagram? Quote suitable example.
2. Define the following terms and give examples
a) cardinality (ii)unary relationships (iii)aggregation (iv)specialization
3. How to maintain class hierarchies in ER-Diagrams? Explain with employee database.
4. Explain the following terms:
a) Entity and entity set.
b) Attribute and attribute sets.
c) Relationship and relationship sets.
5. Define generalization and aggregation. Demonstrate generalization and aggregation using E-R diagram.
6. Explain about Entity-Relationship model with an example.
7. Explain about domain constraints and key constraints.
8. What are the major components used in E-R diagram design?
9. Differentiate between super class and sub class.
10. Construct an ER diagram for university registrar’s office. The office maintains data about each class,
including the instructor, the enrollment and the time and place of the class meetings. For each
student class pair a grade is recorded.
11. Determine the entities and relationships.

Department of CSE, Vishnu Institute of Technology 30


Database Management Systems UNIT-I
12. Explain the following:
a) Ternary relationship b) Weak entity set c) Grouping d) Aggregation.
13. What is ER model? Explain its concepts.
14. Describe entities and relationships with examples.
15. Write about different types of attributes in ER model. Show the notation of each.
16. What is a weak entity type? How to model it? Explain with suitable example.
17. Explain in detail about inheritance, specialization and generalization using ER diagrams.
18. Differentiate specialization and generalization.
19. With the aid of appropriate examples, describe how to model the following in ER model:
a) Entity type ii) Relationship type iii) Super class iv) Sub class
20. Draw an ER diagram for Hospital management system.
21. Explain about various constraints used in ER-model.
22. Explain the difference among Entity, Entity Type & Entity Set
23. Specify and explain various structural constraints of relationship type.

Department of CSE, Vishnu Institute of Technology 31

You might also like