0% found this document useful (0 votes)
4 views47 pages

DDM Notes (1)-Converted

Uploaded by

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

DDM Notes (1)-Converted

Uploaded by

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

UNIT I

CONCEPTUALDATAMODELING

SYLLABUS
Database environment – Database system development lifecycle –

Requirements collection – Database design -- Entity-Relationship model –

Enhanced-ER model – UML class diagrams .


1. Database Environment

1.1 Definition:

 Database: organized collection of logically related data „


 Data: stored representations of meaningful objects and events „
 Structured: numbers, text, dates „
 Unstructured: images video, documents „
 Information: data processed to increase knowledge in the person using the data
 Metadata: data that describes the properties and context of user data.

Fig 1.1 Example for Metadata

Disadvantages of File Processing „

 Program-Data Dependence
 All programs maintain metadata for each file they use „
 Duplication of Data „
 Different systems/programs have separate copies of the same data „
 Limited Data Sharing
 No centralized control of data
 Lengthy Development Times „
 Programmers must design their own file formats „
 Excessive Program Maintenance„
 80% of information systems budget
Problems with Data Redundancy

Waste of space to have duplicate data „


Causes more maintenance headaches „
The biggest problem: „
 Data changes in one file could cause inconsistencies „
 Compromises in data integrity
SOLUTION: The DATABASE Approach„
 Central repository of shared data „
 Data is managed by a controlling agent „
 Stored in a standardized, convenient form
 Requires a Database Management System (DBMS)

1.2 Introduction to Database Management:

A database-management system (DBMS) is a collection of interrelated data and a


set of programs to access those data. The collection of data, usually referred to as
the database, contains information relevant to an enterprise.
The primary goal of a DBMS is to provide a way to store and retrieve database
information that is both convenient and efficient.

Database-System Applications.
 Banking-For customer information,account activities,payments,deposits,loans etc.
 Airlines-For reservations and schedule information.
 Universities- For student information,course registrations,colleges and grades.
 Telecommunications-It helps to keep call records,monthly bills
maintaining balances etc.
 Finance: For storing information about stock, sales and purchases of
financial instruments like stocks and bonds.
 Accounting: Database systems are used in maintaining information
employees, salaries and payroll taxes
 Manufacturing: For management of supply chain and tracking production of
items in factories database systems are maintained.
 Reservations Systems: In airline/railway reservation systems, the database is
used to maintain the reservation and schedule information.

1.3 PURPOSE OF DATABASE SYSTEMS


To allow users to manipulate the information, the system has a number of
application programs that manipulate the files, including programs to:
 Add new students, instructors, and courses
 Register students for courses and generate class rosters
 Assign grades to students, compute grade point averages (GPA), and
generate transcripts
File Processing System
 This typical file-processing system is supported by a conventional operating system.
 The system stores permanent records in various files, and it needs different
application programs to extract records from, and add records to, the
appropriate files. Before database management systems (DBMSs) were
introduced, organizations usually stored information in such systems.
 Keeping organizational information in a file-processing system has a number of
major
disadvantages:

 Data redundancy and inconsistency


 Difficulty in accessing data
 Data isolation
 Integrity problems
 Atomicity problems
 Concurrent-access anomalies
 Security problems
Data redundancy and inconsistency
This redundancy leads to higher storage and access cost. In addition, it may lead to
data inconsistency; that is, the various copies of the same data may no longer agree.
Difficulty in accessing data
Conventional file-processing environments do not allow needed data to be
retrieved in a convenient and efficient manner. More responsive data-retrieval
systems are required for general use.

Data isolation
Because data are scattered in various files, and files may be in different
formats, writing new application programs to retrieve the appropriate data is
difficult.

Integrity problems
The data values stored in the database must satisfy certain types of
consistency constraints.

Atomicity problems
A computer system, like any other device, is subject to failure. In many
applications, it is crucial that, if a failure occurs, the data be restored to the
consistent state that existed prior to the failure.
Concurrent-access anomalies
For the sake of overall performance of the system and faster response, many
systems allow multiple users to update the data simultaneously.

Security problems
Not every user of the database system should be able to access all the data.
For example, in a university, payroll personnel need to see only that part of the
database that has financial information.

Advantages of DBMS:
 Redundancy can be reduced
 Inconsistency can be avoided
 The data can be shared
 Standards can be enforced
 Security can be enforced
 Integrity can be maintained

Disadvantages of DBMS:
 Confidentiality, Privacy and Security
 Enterprise Vulnerability
 The cost of using a DBMS
Database Systems Conventional File systems
Data redundancy is less Data redundancy is more
Security is high Security is very low
Database systems are used when Conventional file systems are used
security constraints are high where there is less demand for security
constraints.
Database systems define the data in a File systems define the data in un-
structured manner. Also there is well structured manner. Data is usually in
defined co-relation among the data. isolated form.
Data inconsistency is less in Data inconsistency is more in
database systems. database systems.

1.4 VIEW OF DATA


A database system is a collection of interrelated data and a set of programs that allow
users to access and modify these data. A major purpose of a database system is to
provide users with an abstract view of the data.
 Data Abstraction
 Instances and Schemas
 Data Models
Data Abstraction
Since many database-system users are not computer trained, developers hide the
complexity from users through several levels of abstraction, to simplify users’
interactions with the system:
 Physical level
The lowest level of abstraction describes how the data are actually stored.
The physical level describes complex low-level data structures in detail.
 Logical level
The next-higher level of abstraction describes what data are stored in the
database, and what relationships exist among those data.
Database administrators, who must decide what information to keep in the
database, use the logical level of abstraction.
 View level
The view level of abstraction exists to simplify their interaction with the
system. The system may provide many views for the same database.
Figure 1.1a shows the relationship among the three levels of abstraction.
Many high-level programming languages support the notion of a structured type. For
example, we may describe a record as follows:

type instructor = record


ID : char (5);
name : char (20);
dept name : char
(20); salary :
numeric (8,2); end;

This code defines a new record type called instructor with four fields. Each field has a
name and a type associated with it. A university organization may have several
such record types, including
o department, with fields dept name, building, and budget
o course, with fields course id, title, dept name, and credits
o student, with fields ID, name, dept name, and tot cred

Fig 1.1 a Three levels of data abstraction


Finally, In fig 1.1 at the view level, computer users see a set of application programs
that hide details of the data types.
At the view level, several views of the database are defined, and a database user sees
some or all of these views.
In addition to hiding details of the logical level of the database, the views also provide a
security mechanism to prevent users from accessing certain parts of the database.

1.4.1 Instances and Schemas


The overall design of the database is called the database schema.

Example:
Roll No Name Marks

The collection of information stored in the database at a particular moment is called an


instance
of the database.
Example:
Roll No Name Marks
1011 AAA 68
1012 BBB 81

Types of Schema:
Database systems have several schemas, partitioned according to the levels of
abstraction.
 The physical schema describes the database design at the physical level of abstraction.
 the logical schema describes the database design at the logical level of abstraction.
 A database may also have several schemas at the view level, sometimes called
subschemas, that describe different views of the database.

1.5 Database Languages:


A database system provides a data-definition language to specify the
database schema and a data-manipulation language to express database
queries and updates. Data-Manipulation Language
A data-manipulation language (DML) is a language that enables users to access
or manipulate data as organized by the appropriate data model. The types of access
are:
•Retrieval of information stored in the database
•Insertion of new information into the database
•Deletion of information from the database
•Modification of information stored in the

database There are basically two types:

•Procedural DMLs require a user to specify what data are needed and how to
get those data.
•Declarative DMLs (also referred to as nonprocedural DMLs) require a user to specify
what data are needed without specifying how to get those data.

A query is a statement requesting the retrieval of information. The portion of a


DML that involves information retrieval is called a query language. Although
technically incorrect, it is common practice to use the terms query language and
data-manipulation languagesynonymously.

Data-Definition Language
 Data Definition Language(DDL) is a specialized language used to specify a
database schema by a set of definitions.
 It is a language which is used for creating and modifying the structure of tables, views
,indexes and so on.
 DDL is also used to specify additional properties of data.
 Some of the common commands used in DDL are CREATE,ALTER,DROP.
1.6 DATA MODELS
Underlying the structure of a database is the data model: a collection of
conceptual tools for describing data, data relationships, data semantics, and
consistency constraints.

1.6.1 Different types of data model


 Entity-relationship model(Graphical/Pictorial representation model)
 Relational model(Record based model)
 Object relational model(Programming model)
o Object Oriented model
o Object Relational model
 Network model
 Hierarchical model

1.6.1.1 Entity-Relationship Model


The entity-relationship (E-R) data model is based on a perception of a real
world that consists of a collection of basic objects, called entities, and of relationships
among these objects(Fig 1.1b)
 An entity is a “thing” or “object” in the real world that is distinguishable
from other objects.
 A relationship is an association among several entities.
 Entities are described in a database by a set of attributes.

Fig: 1.1 b. A Sample ER Diagram

1.6.1.2 Relational Model


The Relational Model uses a collection of tables both data and the
relationship among those data. Each table have multiple columns and each column
has a unique name.
Relational database comprising of two tables
Customer –Table.
Customer- Security Number Address City AccountNumber
Name
Preethi 111-222-3456 Yelhanka Bangalore A-101
Sharan 111-222-3457 Hebbal Bangalore A-125
Preethi 112-123-9878 Jaynagar Bangalore A-456
Arun 123-987-9909 MG road Bangalore A-987
Preethi 111-222-3456 Yelhanka Bangalore A-111
Rocky 222-232-0987 Sanjay Nagar Bangalore A-111
Account –Table
Account-Number Balance
A-101 1000.00
A-125 1200.00
A-456 5000.00
A-987 1234.00
A-111 3000.00
Customer Preethi and Rocky share the same account number A-111

Advantages
1. The main advantage of this model is its ability to represent data in a simplified
format.
2. The process of manipulating record is simplified with the use of certain key
attributes used to retrieve data.
3. Representation of different types of relationship is possible with this model.

1.6.1.3 Object Relational Model (Programming Model)


1.6.1.3.1 Object-Oriented Data Models
 Several models have been proposed for implementing in a database system.
 One set comprises models of persistent O-O Programming Languages
such as C++ (e.g., in OBJECTSTORE or VERSANT), and Smalltalk (e.g., in
 GEMSTONE).
 Additionally, systems like O2, ORION (at MCC – then ITASCA), and IRIS (at
H.P.- used in Open OODB).
1.6.1.3.2 Object-Relational Models
 Most Recent Trend. Started with Informix
 Universal Server.
 Relational systems incorporate concepts from object databases leading
to object relational.
 Object Database Standard: ODMG-93, ODMG-version 2.0, and ODMG-version
3.0.
 Exemplified in the latest versions of Oracle-10i, DB2, and SQL Server
and other DBMSs.
 Standards included in SQL-99 and expected to be enhanced in
future SQL standards.

1.6.1.4 Network Model


The data in the network model are represented by collection of records and
relationships among data are represented by links, which can be viewed as
pointers.

Preeth 111-222- yelhank Bangalor


i 3456 a e

A-101 1000.00

A-111 3000.00
The records in the database are organized as collection of arbitrary groups.
Advantages:
1. Representation of relationship between entities is implemented using
pointers which allows the representation of arbitrary relationship
2. Unlike the hierarchical model it is easy.
3. Data manipulation can be done easily with this model.
1.6.1.5 Hierarchical Model
A hierarchical data model is a data model which the data is organized into a
tree like structure. The structure allows repeating information using parent/child
relationships: each parent can have many children but each child only has one
parent(Fig 1.2). All attributes of a specific record are listed under an entity type.

Fig 1.2: Hierarchical Model


Advantages:
1. The representation of records is done using an ordered tree, which is natural
method of implementation of one–to-many relationships.
2. Proper ordering of the tree results in easier and faster retrieval of records.
3. Allows the use of virtual records.

1.7.Data Independence
 A database system normally contains a lot of data in addition to users’ data.
For example, it stores data about data, known as metadata, to locate and
retrieve data easily.
 It is rather difficult to modify or update a set of metadata once it is stored in
the database.
 But as a DBMS expands, it needs to change over time to satisfy the
requirements of the users. If the entire data is dependent, it would become a
tedious and highly complex job.
 Metadata itself follows a layered architecture, so that when we change
data at one layer, it does not affect the data at another level. This
data is independent but mapped to each other.

Fig 1.3 Data Independence

Logical Data Independence


 Logical data is data about database, that is, it stores information about how
data is managed inside. For example, a table (relation) stored in the
database and all its constraints, applied on that relation.
 Logical data independence is a kind of mechanism, which liberalizes itself
from actual data stored on the disk. If we do some changes on table format,
it should not change the data residing on the disk.
Physical Data Independence
 All the schemas are logical, and the actual data is stored in bit format on the
disk. Physical data independence is the power to change the physical data
without impacting the schema or logical data.
 For example, in case we want to change or upgrade the storage system itself
− suppose we want to replace hard-disks with SSD − it should not have any
impact on the logical data or schemas.

1.8 Three schema Architecture


o The three schema architecture is also called ANSI/SPARC architecture or
three-level architecture.
o This framework is used to describe the structure of a specific database system.
o The three schema architecture is also used to separate the user
applications and physical database.
o The three schema architecture contains three-levels. It breaks the database
down into three different categories.

The three-schema architecture is as follows:

In the above diagram:


o It shows the DBMS architecture.
o Mapping is used to transform the request and response between various
database levels of architecture.
o Mapping is not good for small DBMS because it takes more time.
o In External / Conceptual mapping, it is necessary to transform the request
from external level to conceptual schema.
o In Conceptual / Internal mapping, DBMS transform the request from the
conceptual to internal level.
1.8.1 Objectives of Three schema Architecture
The main objective of three level architecture is to enable multiple users to
access the same data with a personalized view while storing the underlying data
only once. Thus it separates the user's view from the physical structure of the
database. This separation is desirable for the following reasons:
o Different users need different views of the same data.
o The approach in which a particular user needs to see the data may change over
time.
o The users of the database should not worry about the physical
implementation and internal workings of the database such as data
compression and encryption techniques, hashing, optimization of the internal
structures etc.
o All users should be able to access the same data according to their requirements.
o DBA should be able to change the conceptual structure of the database
without affecting the user's
o Internal structure of the database should be unaffected by changes to
physical aspects of the storage.

1. Internal Level

o The internal level has an internal schema which describes the physical
storage structure of the database.
o The internal schema is also known as a physical schema.
o It uses the physical data model. It is used to define that how the data will be
stored in a block.
o The physical level is used to describe complex low-level data structures in detail.

The internal level is generally is concerned with the following activities:


 Storage space allocations.
For Example: B-Trees, Hashing etc.

o Access paths.
For Example: Specification of primary and secondary keys, indexes, pointers and
sequencing.
o Data compression and encryption techniques.
o Optimization of internal structures.
o Representation of stored fields.

2. Conceptual Level

o The conceptual schema describes the design of a database at the


conceptual level. Conceptual level is also known as logical level.
o The conceptual schema describes the structure of the whole database.
o The conceptual level describes what data are to be stored in the database
and also describes what relationship exists among those data.
o In the conceptual level, internal details such as an implementation of the
data structure are hidden.
o Programmers and database administrators work at this level.

3. External Level

o At the external level, a database contains several schemas that sometimes


called as subschema. The subschema is used to describe the different view of
the database.
o An external schema is also known as view schema.
o Each view schema describes the database part that a particular user group is
interested and hides the remaining database from that user group.
o The view schema describes the end user interaction with database systems.

1.9 Components of DBMS:

The major components of database management system are:


 Software
 Hardware
 Data
 Procedures
 Database Access Language
 Users
2. Database System Development Lifecycle

Information System:

 Resources that enable collection, management, control, and


dissemination of information throughout an organization.
 Database is fundamental component of IS, and its development/usage should
be viewed from perspective of the wider requirements of the organization.

Database System Development Lifecycle

 Database planning
 System definition
 Requirements collection and analysis
 Database design
 DBMS selection (optional)
 Application design
 Prototyping (optional)
 Implementation
 Data conversion and loading
 Testing
 Operational maintenance

System Definition

 Describes scope and boundaries of database system and the major user views.
 User view defines what is required of a database system from perspective of:
 a particular job role (such as Manager or Supervisor) or
 enterprise application area (such as marketing, personnel, or stock control).

2.1 Requirements Collection and Analysis

 Information is gathered for each major user view including:


 a description of data used or generated;
 details of how data is to be used/generated;
 any additional requirements for new database system.

Three main approaches:

 centralized approach;
 view integration approach;
 combination of both approaches.

I) Centralized approach

 Requirements for each user view are merged into a single set of requirements.
 A data model is created representing all user views during the database design
stage.
Fig 2.1 Centralized Approach to Managing Multiple User Views

II) View integration approach


 Requirements for each user view remain as separate lists.
 Data models representing each user view are created and then merged
later during the database design stage.

Fig 2.2 View integration approach


2.2 Database Design
 Process of creating a design for a database that will support the
enterprise’s mission statement and mission objectives for the required
database system
 Database Design Main approaches include:
 Top-down
 Bottom-up
 Inside-out
 Mixed
 Main purposes of data modeling include:
 to assist in understanding the meaning (semantics) of the data;
 to facilitate communication about the information requirements.
 Building data model requires answering questions about entities,
relationships, and attributes
 A data model ensures we understand:
 each user’s perspective of the data;
 nature of the data itself, independent of its physical representations;
 use of data across user
views. Two phases of database
design:
 Conceptual database design / Logical database design
 Physical database design.

Logical Database Design / Conceptual Database Design

 Process of constructing a model of the data used in an enterprise based


on a specific data model (e.g. relational), but independent of a particular
DBMS and other physical considerations.
 Conceptual data model is refined and mapped on to a logical data model.

Physical Database Design


 Process of producing a description of the database implementation on
secondary storage.
 Describes base relations, file organizations, and indexes used to
achieve efficient access to data
 Also describes any associated integrity constraints and security measures.

Fig 2.3 Three-Level ANSI-SPARC Architecture and Phases of Database Design

Application Design:

 Design of user interface and application programs that use and process the
database.
 Database design and application design are parallel activities.
Prototyping:

 Building working model of a database system.


 Purpose:
 to identify features of a system that work well, or are inadequate;
 to suggest improvements or even new features;
 to clarify the users’ requirements;
 to evaluate feasibility of a particular system design.

Implementation

 Physical realization of the database and application designs.


 Use DDL to create database schemas and empty database files.
 Use DDL to create any specified user views.
 Create the application programs.

Data Conversion and Loading

 Transferring any existing data into new database and converting


any existing applications to run on new database.

Testing

 Process of running the database system with intent of finding errors.


 Testing cannot show absence of faults; it can show only that software faults are
present.
 Demonstrates that database and application programs appear to be
working according to requirements.

Operational Maintenance

 Process of monitoring and maintaining database system following installation.


 Monitoring performance of system.
 if performance falls, may require tuning or reorganization of the database.
 Maintaining and upgrading database application (when required).
 Incorporating new requirements into database application.

Data Administration and Database Administration

 The Data Administrator (DA) and Database Administrator (DBA) are


responsible for managing and controlling the corporate data and
corporate database, respectively.
 DA is more concerned with early stages of database system development
lifecycle and DBA is more concerned with later stages.
3.ENTITY-RELATIONSHIP MODEL
Methodology:
1. E-R data model is popular for high level database design, provides a means
for representing relationships between entities. This approach was
profounded by P.P chen in 1976. The salient features of the E-R model are
represented in the following section.
 This is used to give structure to data.
 Model can be evolved independent of any DBMS.
 It is easy to visualize and understand.
2. The database structure, employing the E-R model is usually depicted
pictorially using entity-relationship (E-R) diagram.

Fig:3.1 ER Model

Symbols used in E-R Diagram (Fig 3.1)


 Entity – rectangle
 Attribute – oval
 Relationship – diamond
 Link – line
3.1 Basic concepts
There are three basic conventions that the E-R model employs:
 Entity set
 Attributes
 Relational sets
a) Entity Set:
An entity is a “thing” or “object” in the real world that is distinguishable
from all other objects.
Example: a particular person, car, house, etc.
An entity has set of properties, and the values for some set of properties may
uniquely identify an entity.
For example: person may a have a person-id property whose value uniquely
identifies that person.
An entity set is a collection of entities having the same properties.
The individual entities in an entity set are called the extension of the
entity set. All the individual bank customers are the extension of the
entity set customer.

b) Attributes:
The properties that describe an entity are called
attributes. In the customer entity customer id, name,
street are the attributes. An attribute can be classified
into various types.
 Simple Attribute: An attribute that cannot be divided into further subparts.

Example: Customer-id of customer entity.


 Composite Attribute: An attribute that can be divided into a set of subparts.
Example: In a customer entity, the attribute name can further be divided into
first name, middle-name, last-name.
 Single value Attribute:An attribute having only one value in a particular entity.
Example: In a customer entity, name, id, street are single valued
attributes.
 Multi-valued Attributes: An attribute having more than one value for a
particular entity. Example: Consider the customer entity set with the attribute
phone no. A customer may have zero, one or several phone nos and
different customers may have different numbers of phone.
 Derived attribute: An attribute that is derived from other related attributes or
entities. Example: The age of a customer entity set is derived from the
attribute date-of-birth of a customer.
c) Relationship set
A relationship is used to describe the relation between entities. Diamond or
rhombus is used to represent the relationship.
Relationship set is a set of relationships of the same type.
For example, relationship set borrower denotes the association between
customer and bank loan entity sets.

Recursive relationship set:


Same entity set participates in a relationship set more than once, in different roles
For example, employee entity set participates in relationship set works for as
manager or worker. A relationship set may also have descriptive attributes.
The number of entity sets that participate in a relationship set is called the
degree of relationship set.
Binary relationship set: Relationship between 2 entity sets.

Ternary relationship set: Relationship between 3 entity sets.

3.2 Constraints:
An E-R enterprise schema may define certain constraints to which the constraints to
which the contents of a database must conform.
Two types of constraints are
1. Mapping cardinalities
2. Participation constraint
1. Mapping Cardinalities
Mapping Cardinalities or Cardinality ratio is defined as the number of times an
entity of an entity set participates in a relationship set is known as cardinality.
Cardinality can be of different types:
 One to one – When each entity in each entity set can take part only once
in the relationship, the cardinality is one to one.

 One to Many – An entity in A is associated with any number of entities in B,


and an entity in B is associated with any number of entities in A.
 Many to one – An entity in A is associated with at most one entity
in
B. An entity in B can be associated with any number of entities in A.

 Many to many – When entities in all entity sets can take part

more than once in the relationship cardinality is many to


many.

2. Participation Constraints:
It specifies whether the existence of an entity depends on its being related to
another entity via the relationship type.
Types:
1) Total participation
 Every member of entity set must participate in the relationship
 Represented by double line from entity rectangle to relationship diamond.
 E.g., Every entity in “total set” of employee entities must be related to a
department entity via, WORKS FOR.

2) Partial participation
 Not every entity instance must participate
 Represented by single line from entity rectangle to relationship diamond
 E.g., Not every employee manages a department, so the participation of
employee in the manages relationship type is partial. “Part of the set of”
employee entities are related to the department entity via manages
relationship.

3)Weak Entity Set


 An entity that depends on another entity called a weak entity. The weak
entity doesn't contain any key attribute of its own. The weak entity is
represented by a double rectangle.

4) Strong Entity Set


 Entity types that have key attributes of their own are called strong entity types.
 A strong entity set is indicated in E-R diagrams by rectangular box and its
relationship by a diamond.
3.3 GRAPHICAL REPRESENTATION IN E-R DIAGRAM
Rectangle -- to represent an entity set
Ellipses -- to represent an attribute (underlined attributes are [part of] the primary
key)(Fig. 2.2) Diamond – to represent relationship sets.
Lines – to link attributes to entity sets and entity sets to relationship
sets. Double ellipses -- multi-valued attribute
Dashed ellipses-- derived attribute, e.g. age is derivable from birthdate and
current date. Double rectangle – to represent weak entity sets.
Double line – to represent total participation of an entity in a relationship set.
ER Diagram Example
This was produced with Dia. It is the same as the figure in the book using
instructor's preferred style.
ER-diagram of the Company Database representing the summary specifications
E-R diagram for company database
E-R diagram for Hospital:
4. ENHANCED ENTITY-RELATIONSHIP MODEL
The Extended Entity-Relationship Model is a more complex and high-level
model that extends an E-R diagram to include more types of abstraction, and to
more clearly express constraints.
All of the concepts contained within an E-R diagram are included in the EE-R
model, along with additional concepts that cover more semantic information. These
additional concepts include generalization/specialization, union, inheritance, and
subclass/superclass.
 Specialization
 Generalization
 Attribute Inheritance
 Constraints on Generalizations
 Aggregation
4.1 Specialization
An entity set may include subgroupings of entities that are distinct in some
way from other entities in the set. The E-R model provides a means for representing
these distinctive entity groupings.
As an example, the entity set person may be further classified as one of the following:
 employee.
 student.
The process of designating subgroupings within an entity set is called specialization.

Fig 4.1 EER diagram to represent specialization


Fig 4.2 Instances of a specialization

4.2 Generalization
The refinement from an initial entity set into successive levels of entity
subgroupings represents a top-down design process in which distinctions are made
explicit.
Higher- and lower-level entity sets also may be designated by the terms superclass
and
subclass, respectively.
In generalization, a number of entities are brought together into one
generalized entity based on their similar characteristics.
For example, pigeon, house sparrow, crow and dove can all be generalized as Birds.

Fig 4.3 Generalization


4.3 Attribute Inheritance
Acrucial property of the higher- and lower-level entities created by
specialization and generalization is attribute inheritance. The attributes of the higher-
level entity sets are said to be inherited by the lower-level entity sets.
For example, student and employee inherit the attributes of person. Thus, student
is described by its ID, name, and address attributes, and additionally a tot cred
attribute; employee is described by its ID, name, and address attributes, and
additionally a salary attribute.
A higher-level entity set with attributes and relationships that apply to all of
its lower-level entity sets.
Lower-level entity sets with distinctive features that apply only within a
particular lower- level entity set.

Fig 4.4 Attribute Inheritance

4.4 Constraints on Generalizations


Condition-defined
In condition-defined lower-level entity sets,membership is evaluated on
the basis of whether or not an entity satisfies an explicit condition or predicate.

User-defined
User-defined lower-level entity sets are not constrained by a membership
condition; rather, the database user assigns entities to a given entity set.
In this constraint the decision is left to the super class that how many instances
of the super class will be participating in the sub class.
In the given example Team leader decides which team will join according to skills.
Attribute defined
This refers to specifying conditions on more than one attribute.
Example
Consider a database for the marks and attendance.
This type of constraint is defined on two or more attributes for the given entity
which is further divided into subclass entities.

Here the condition can be specified on more than two


attributes. For example, Account types savings and
current.
For savings and current accounts, we can perform balance, withdrawal, deposit
same but type is different.
Disjoint
Disjoint is nothing but intersection, the number of instances specified for the given
superclass can participate in only one of the sub classes.
Account users can participate in saving account and current account but both are
different so, it can be participated one at a time.
It is just like a minus, as shown below −

Overlapping
Two or more instances of the super class are participating in two or more sub
classes then it is called overlapping constraints.
Example
A person who knows Java and PHP can participate in both teams.

4.5 Aggregation
 One limitation of the E-R model is that it cannot express relationships
among relationships.
 The best way to model a situation such as the one just described is to use
aggregation.
 Aggregation is an abstraction through which relationships are treated as
higher-level entities
Fig .4.5 Aggregation

5. UML Class Diagrams

 The class diagram depicts a static view of an application.


 It represents the types of objects residing in the system and the relationships
between them.
 A class consists of its objects, and also it may inherit from other classes.
 A class diagram is used to visualize, describe, document various different
aspects of the system, and also construct executable software code.
 It shows the attributes, classes, functions, and relationships to give an
overview of the software system.
 It constitutes class names, attributes, and functions in a separate
compartment that helps in software development.
 Since it is a collection of classes, interfaces, associations,
collaborations, and constraints, it is termed as a structural diagram.

5.1 Purpose of Class Diagrams

The main purpose of class diagrams is to build a static view of an application. It is


the only diagram that is widely used for construction, and it can be mapped with
object-oriented languages. It is one of the most popular UML diagrams. Following
are the purpose of class diagrams given below:

1. It analyses and designs a static view of an application.


2. It describes the major responsibilities of a system.
3. It is a base for component and deployment diagrams.

4. It incorporates forward and reverse engineering.

5.2 Benefits of Class Diagrams


1. It can represent the object model for complex systems.
2. It reduces the maintenance time by providing an overview of how an
application is structured before coding.
3. It provides a general schematic of an application for better understanding.
4. It represents a detailed chart by highlighting the desired code, which
is to be programmed.
5. It is helpful for the stakeholders and the developers.

5.3 Vital components of a Class Diagram

The class diagram is made up of three sections:

o Upper Section: The upper section encompasses the name of the class. A class
is a representation of similar objects that shares the same relationships,
attributes, operations, and semantics. Some of the following rules that should
be taken into account while representing a class are given below:

a. Capitalize the initial letter of the class name.


b. Place the class name in the center of the upper section.
c. A class name must be written in bold format.

d. The name of the abstract class should be written in italics format.

Middle Section: The middle section constitutes the attributes, which describe the quality
of the class. The attributes have the following characteristics:
. The attributes are written along with its visibility factors, which are public (+),
private (-), protected (#), and package (~).
a. The accessibility of an attribute class is illustrated by the visibility factors.
b. A meaningful name should be assigned to the attribute, which will
explain its usage inside the class.

Lower Section: The lower section contains methods or operations. The methods are
represented in the form of a list, where each method is written in a single line. It
demonstrates how a class interacts with data.
5.4 Relationships
In UML, relationships are of three types:
o Dependency: A dependency is a semantic relationship between two or more
classes where a change in one class cause changes in another class. It forms
a weaker relationship.
In the following example, Student_Name is dependent on the Student_Id.

o Generalization: A generalization is a relationship between a parent class


(superclass) and a child class (subclass). In this, the child class is inherited
from the parent class. For example, The Current Account, Saving Account,
and Credit Account are the generalized form of Bank Account.
o Association: It describes a static or physical connection between two or more
objects. It depicts how many objects are there in the
relationship. For example, a department is associated with the college.

5.5 Multiplicity: It defines a specific range of allowable instances of attributes. In


case if a range is not specified, one is considered as a default multiplicity.

For example, multiple patients are admitted to one hospital.

Aggregation: An aggregation is a subset of association, which represents has a


relationship. It is more specific then association. It defines a part-whole or part-of
relationship. In this kind of relationship, the child class can exist independently of its
parent class.

The company encompasses a number of employees, and even if one employee


resigns, the company still exists.

Composition: The composition is a subset of aggregation. It portrays the


dependency between the parent and its child, which means if one part is deleted,
then the other part also gets discarded. It represents a whole-part relationship.

A contact book consists of multiple contacts, and if you delete the contact book, all
the contacts will be lost.
5.6 Abstract Classes

In the abstract class, no objects can be a direct entity of the abstract class. The
abstract class can neither be declared nor be instantiated. It is used to find the
functionalities across the classes. The notation of the abstract class is similar to that
of class; the only difference is that the name of the class is written in italics. Since it
does not involve any implementation for a given function, it is best to use the
abstract class with multiple objects.

Let us assume that we have an abstract class named displacement with a method
declared inside it, and that method will be called as a drive (). Now, this abstract
class method can be implemented by any object, for example, car, bike, scooter,
cycle, etc.

5.7 How to draw a Class Diagram?

The class diagram is used most widely to construct software applications. It not only
represents a static view of the system but also all the major aspects of an
application. A collection of class diagrams as a whole represents a system.

Some key points that are needed to keep in mind while drawing a class diagram are
given below:

1. To describe a complete aspect of the system, it is suggested to give a


meaningful name to the class diagram.
2. The objects and their relationships should be acknowledged in advance.
3. The attributes and methods (responsibilities) of each class must be known.

4. A minimum number of desired properties should be specified as more


number of the unwanted property will lead to a complex diagram.
5. Notes can be used as and when required by the developer to describe the
aspects of a diagram.
6. The diagrams should be redrawn and reworked as many times to make it
correct before producing its final version.

5.8 Class Diagram Example

A class diagram describing the sales order system is given below.

5.9 Usage of Class diagrams


The class diagram is used to represent a static view of the system. It plays an essential
role in the establishment of the component and deployment diagrams. It helps to
construct an executable code to perform forward and backward engineering for any
system, or we can say it is mainly used for construction. It represents the mapping
with object-oriented languages that are C++, Java, etc. Class diagrams can be used
for the following purposes:
1. To describe the static view of a system.
2. To show the collaboration among every instance in the static view.
3. To describe the functionalities performed by the system.
4. To construct the software application using object-oriented languages.
Part – A

1. Who is a DBA? What are the responsibilities of a DBA? April/May-2011

A database administrator (short form DBA) is a person responsible for the design,
implementation, maintenance and repair of an organization's database. They are
also known bythe titles Database Coordinator or Database Programmer, and is
closely related to the DatabaseAnalyst, Database Modeller, Programmer Analyst,
and Systems Manager.

The role includes the development and design of database strategies, monitoring and
improving database performance and capacity, and planning for future expansion
requirements. They may also plan, co-ordinate and implement security measures to
safeguard the database

2. What is a data model? List the types of data model used. April/May-2011

A database model is the theoretical foundation of a database and fundamentally


determines inwhich manner data can be stored, organized, and manipulated in a
database system. It thereby defines the infrastructure offered by a particular
database system. The most popular example of a database model is the relational
model.

Types of data model used


Ø Hierarchical model
Ø Network model
Ø Relational model Ø
Entity-relationship
Ø Object-relational model

3. Define database management system?


Database management system (DBMS) is a collection of interrelated data and a set
of programs to access those data.

4. List any eight applications of DBMS.


a) Banking
b) Airlines
c) Universities
d) Credit card transactions
e) Tele communication
f) Finance g) Sales
h) Manufacturing
i) Human resources

5. What are the disadvantages of file processing system?


The disadvantages of file processing systems are
a) Data redundancy and inconsistency
b) Difficulty in accessing data
c) Data isolation
d) Integrity problems
e) Atomicity problems
f) Concurrent access anomalies

6. What are the advantages of using a DBMS?


The advantages of using a DBMS are
a) Controlling redundancy
b) Restricting unauthorized access
c) Providing multiple user interfaces
d) Enforcing integrity constraints.
e) Providing backup and recovery

7. Give the levels of data abstraction?


a) Physical level
b) Logical level
c) View level

8. Define instance and schema?


Instance: Collection of data stored in the data base at a particular moment is called
an Instance of the database.
Schema: The overall design of the data base is called the data base schema.

9. Define the terms


1) Physical schema
2) logical schema.

Physical schema: The physical schema describes the database design at the physical
level, which is the lowest level of abstraction describing how the data are actually
stored.
Logical schema: The logical schema describes the database design at the logical level,
which describes what data are stored in the database and what relationship exists among
the data.

10. Mention the actors on scene.


 Database administrator
 Database designer
 End users

11. What is conceptual schema?


The schemas at the view level are called subschema‟s that describe different views
of the database.
12. Define data model?
A data model is a collection of conceptual tools for describing data, data relationships,
data

13. What is storage manager?


A storage manager is a program module that provides the interface between the
low level data stored in a database and the application programs and queries
submitted to the system.

14. What are the components of storage manager?


The storage manager components include
a) Authorization and integrity manager
b) Transaction manager
c) File manager
d) Buffer manager

15. What is the purpose of storage manager?


The storage manager is responsible for the following

a) Interaction with the file manager


b) Translation of DML commands in to low level file system commands
c) Storing, retrieving and updating data in the database

16. List the data structures implemented by the storage manager .


The storage manager implements the following data structure
a) Data files
b) Data dictionary
c) Indices

17. What is a data dictionary?


A data dictionary is a data structure which stores meta data about the structure of
the database ie. the schema of the database.

18. What is an entity relationship model?


The entity relationship model is a collection of basic objects called entities and
relationship among those objects. An entity is a thing or object in the real world that
is distinguishable from other objects.

19. What are attributes? Give examples.


An entity is represented by a set of attributes. Attributes are descriptive properties

possessed by each member of an entity set.

Example: possible attributes of customer entity are customer name, customer id,
Customer Street, customer city.
20. What is relationship? Give examples
A relationship is an association among several entities.
Example: A depositor relationship associates a customer with each account that he/she
has.

21. Define the terms i) Entity set ii) Relationship set

Relationship set : The set of all relationships of the same type is termed as a relationship
set.

22. Define single valued and multivalued attributes.

Single valued attributes: attributes with a single value for a particular entity are
called single valued attributes.
Multivalued attributes : Attributes with a set of value for a particular
entity are Called multivalued attributes.

23. What are stored and derived attributes?


Stored attributes: The attributes stored in a data base are called stored attributes.
Derived attributes: The attributes that are derived from the stored attributes are called
derived attributes.

24. What are composite attributes?


Composite attributes can be divided in to sub parts.

25. Define null values


In some cases a particular entity may not have an applicable value for an attribute
or if we do not know the value of an attribute for a particular entity. In these cases
null value is used.

26. Define the terms i) Entity type ii) Entity set


Entity type: An entity type defines a collection of entities that have the same attributes.
Entity set: The set of all entities of the same type is termed as an entity set.

27. What is meant by the degree of relationship set?


The degree of relationship type is the number of participating entity types.

28. Define the terms

i) Key attribute
ii) Value set

Key attribute : An entity type usually has an attribute whose values are distinct from each
individual entity in the collection. Such an attribute is called a key attribute.

Value set: Each simple attribute of an entity type is associated with a value set that
specifies the set of values that may be assigned to that attribute for each individual
entity.

29. Define weak and strong entity sets?

Weak entity set: entity set that do not have key attribute of their own are called
weak entity sets. Strong entity set: Entity set that has a primary key is termed a
strong entity set.

30. What does the cardinality ratio specify?


Mapping cardinalities or cardinality ratios expres s the number of entities to which
another entity can be associated. Mapping cardinalities must be one of the
following:
•One to one
•One to many
•Many to one

31. Explain the two types of participation constraint.


•Total: The participation of an entity set E in a relationship set R is said to be
total if every entity in E participates in at least one relationship in R.
•Partial: if only some entities in E participate in relationships in R, the participation
of entity set E in relationship R is said to be partial.

32. List the disadvantages of relational database system


 Repetition of data
 Inability to represent certain information.

33. Define the terms i) DDL ii) DML
DDL: Data base schema is specified by a set of definitions expressed by a special
language called a data definition language.
DML:
A data manipulation language is a language that enables users to access or manipulate
data as organized by the appropriate data model

34. Write short notes on relational model


The relational model uses a collection of tables to represent both data and the
relationships among those data. The relational model is an example of a record
based model.

35. Define tuple and attribute

•Attributes: column headers


•Tuple : Row
36. List the table modification commands in SQL?
 Deletion
 Insertion
 Updates
 Update of a view

37. Difference between Database Systems and Conventional File Systems.


Database Systems Conventional File systems
Data redundancy is less Data redundancy is more
Security is high Security is very low
Database systems are used when Conventional file systems are used
security constraints are high where there is less demand for security
constraints.
Database systems define the data in a File systems define the data in un-
structured manner. Also there is well structured manner. Data is usually in
defined co-relation among the data. isolated form.
Data inconsistency is less in Data inconsistency is more in
database systems. database systems.

PART-B

1. Explain the three different groups of data models with suitable examples.
2. i) Explain the concepts of specialization and generalization in E-R data modeling
ii) Explain three schema architecture in detail with a neat diagram
3. i) Draw the ER diagram for banking systems.
4. Explain Entity relational model with a neat diagram.
5. Explain EER model?
6. Explain the concept of UML class diagram?
7. Explain the three types of data model in detail?
8. Explain Database System Management Life cycle in detail ?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy