SlideShare a Scribd company logo
1 of 21
Download to read offline
1 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Chapter 02:
Data Models: The importance of data models, Basic building blocks, Business rules, The
evolution of data models, Degrees of data abstraction.
What is Data Model?
 In general terms, a model is an abstraction of a more complex real-world object
or event. Data models define how the logical structure of a database is modeled.
 Data Models are fundamental entities to introduce abstraction in a DBMS.
 Data models define how data is connected to each other and how they are
processed and stored inside the system. A data model is a relatively simple
representation, usually graphical, of more complex real-world data structures.
Importance of data Models
 Data constitute the most basic information units employed by a system.
Applications are created to manage data and to help transform data into
information. But data are viewed in different ways by different people. So that
there is a huge importance of data modeling in DBMS.
 Data models can facilitate interaction among the designer, the applications
programmer, and the end user.
 A well-developed data model can even foster improved understanding of the
organization for which the database design is developed. In short, data models
are a communication tool.
 The importance of data modeling cannot be overstated. Data constitutes the most
basic information employed by a system. Applications are created to manage
data and to help transform data into information, but data is viewed in different
ways by different people.
2 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Hierarchical Model
 A hierarchical database model is a data model in which the data is organized into
a tree-like structure. The data is stored as records which are connected to one
another through links.
 A record is a collection of fields, with each field containing only one value.
The entity type of a record defines which fields the record contains.
 A record in the hierarchical database model corresponds to a row (or tuples) in
the relational database model and an entity type corresponds to a table (or
relation).
 The hierarchical database model mandates that each child record has only one
parent, whereas each parent record can have one or more child records.
3 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Advantages :
 Easy to understand
 Performance is better than relational data model
Disadvantages :
 Difficult to access values at lower level
 This model may not be flexible to accommodate the dynamic needs of an
organization
 Deletion of parent node result in deletion of child node forcefully
Network Model
 The network model is a database model conceived as a flexible way of
representing objects and their relationships. Its distinguishing feature is that the
schema, viewed as a graph in which object types are nodes and relationship
types are arcs.
 While the hierarchical database model structures data as a tree of records, with
each record having one parent record and many children, the network model
allows each record to have multiple parent and child records, forming a
generalized graph structure.
4 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Advantages:
 Easy access to data
 Highly Flexible & Efficient
 This model can be applied to real world problems that require routine transactions.
Disadvantages:
 Complex to design and develop.
 Extra memory is required for storage of pointers
 Performance is inflexible and difficult to use.
 Operation and maintenance are time consuming and expensive for large databases.
Relational Model
 It represents the database as a collection of relations. A relation is nothing but a
table of values. Every row in the table represents a collection of related data
values. These rows in the table denote a real-world entity or relationship.
 The most popular data model in DBMS is the Relational Model. This model is
based on first-order predicate logic and defines a table as an n-ary relation.
 The table name and column names are helpful to interpret the meaning of values
in each row. The data are represented as a set of relations. In the relational
model, data are stored as tables. However, the physical storage of the data is
independent of the way the data are logically organized.
Some popular Relational Database management systems are:
 Oracle and RDB – Oracle
 SQL Server and Access - Microsoft
5 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Characteristics:
 Data is stored in tables called relations.
 Relations can be normalized.
 In normalized relations, values saved are atomic values.
 Each row in a relation contains a unique value.
 Reflects real-world structure of the problem
 Can represent all expected data over time
 Avoids redundant storage of data items
 Provides efficient access to data
 Supports the maintenance of data integrity over time
 Clean, consistent, and easy to understand
 Each column in a relation contains values from a same domain.
Advantages:
 Easy to use and understand and very flexible.
 Provides excellent support for adhoc queries.
 Users need not consider issues such as storage structure and access strategy.
 Specify control and authorization can be implemented more easily.
 Data independence is achieved more easily with normalization structure used
in a relational database.
Disadvantages–
 For large databases, the performance in responding to queries is definitely
degraded.
 The processing requirements need to construct the indexes. So, the index
position of the file must be created and maintained along with the file records
themselves. The file index must be searched sequentially before the actual file
records are obtained. This is time consuming.
6 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Entity Relationship Model
 An Entity–relationship model (ER model) describes the structure of a database
with the help of a diagram, which is known as Entity Relationship Diagram (ER
Diagram).
 An ER diagram shows the relationship among entity sets. An entity set is a group
of similar entities and these entities can have attributes.
 In terms of DBMS, an entity is a table or attribute of a table in a database, so by
showing relationships among tables and their attributes, the ER diagram shows
the complete logical structure of a database.
 Let's have a look at a simple ER diagram to understand this concept.
In the following diagram we have two entities Student and College and their
relationship. The relationship between Student and College is many to one as a
college can have many students however a student cannot study in multiple
colleges at the same time. Student entity has attributes such as Stu_Id, Stu_Name
& Stu_Addr and College entity has attributes such as Col_ID & Col_Name.
7 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Entity
 An entity is an object or component of data. An entity is represented as a
rectangle in an ER diagram. For example: In the following ER diagram we have
two entities Student and College and these two entities have many to one
relationship as many students study in a single college. We will read more about
relationships later, for now focus on entities.
 Weak Entity: An entity that cannot be uniquely identified by its own attributes
and relies on the relationship with another entity is called a weak entity. The
weak entity is represented by a double rectangle.
 Strong Entity: The Strong Entity is the one whose existence does not depend on
the existence of any other entity in a schema. It is denoted by a single rectangle.
A strong entity always has the primary key in the set of attributes that describes
the strong entity. It indicates that each entity in a strong entity set can be
uniquely identified. For example – a bank account cannot be uniquely identified
without knowing the bank to which the account belongs, so a bank account is a
weak entity and a bank is a strong entity as it is uniquely identified by its bank
number/IFSC.
2. Attribute
An attribute describes the property of an entity. An attribute is represented as Oval
in an ER diagram. There are four types of attributes: 1. Key attribute 2. Composite
attribute 3. Multivalued attribute 4. Derived attribute
Key attribute: A key attribute can uniquely identify an entity from an entity set. For
example, a student roll number can uniquely identify a student from a set of
students. Key attribute is represented by oval the same as other attributes however
the text of key attribute is underlined.
8 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Composite attribute: An attribute that is a combination of other attributes is known
as a composite attribute. For example, in a student entity, the student address is a
composite attribute as an address is composed of other attributes such as pin code,
state, country. Your name can be also termed as composite attribute which has
FNAME MNAME LNAME
Multivalued attribute: An attribute that can hold multiple values is known as
multivalued attribute. It is represented with double ovals in an ER Diagram. For
example – A person can have more than one phone number so the phone number
attribute is multivalued.
Derived attribute: A derived attribute is one whose value is dynamic and derived
from another attribute. It is represented by a dashed oval in an ER Diagram. For
example – Person age is a derived attribute as it changes over time and can be
derived from another attribute (Date of birth).
Relationship
 A relationship is represented by diamond shape in ER diagram; it shows the
relationship among entities. When relationships are mapped with entities in
different ways then it is also termed as Mapping Cardinalities that represents
association or relationship between two entities.
 There are four types of cardinalities: 1. One to One 2. One to Many 3. Many to
One 4. Many to Many
One to One Relationship :When a single instance of an entity is associated with a
single instance of another entity then it is called one to one relationship. For
example, a person has only one passport and a passport is given to one person.
9 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
One to Many Relationship:When a single instance of an entity is associated with
more than one instances of another entity then it is called one to many
relationship. For example – a customer can place many orders but a order cannot be
placed by many customers.
Many to One Relationship: When more than one instances of an entity is associated
with a single instance of another entity then it is called many to one relationship. For
example – many students can study in a single college but a student cannot study in
many colleges at the same time.
Many to Many Relationships: When more than one instance of an entity is
associated with more than one instance of another entity then it is called many to
many relationship. For example, a student can be assigned too many projects and a
project can be assigned to many students.
Total Participation of an Entity set: A Total participation of an entity set represents
that each entity in entity set must have at least one relationship in a relationship set.
For example: In the below diagram each college must have at-least one associated
Student. it is denoted using double lines.
10 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Partial Participation- It specifies that each entity in the entity set may or may not
participate in the relationship instance in that relationship set. That is why, it is also
called as optional participation. Partial participation is represented using a single
line between the entity set and relationship set.
ERD NOTATIONS:
11 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
ERD ISSUES
1. Use of Entity Sets V/s Attributes : Consider the entity set instructor with the
additional attribute phone number. It can easily be argued that a phone is an entity
in its own right with attributes phone number and location; the location may be the
office or home where the phone is located, with mobile (cell) phones perhaps
represented by the value “mobile.” If we take this point of view, we do not add the
attribute phone number to the instructor. Rather, we create: A phone entity set with
attributes phone number and location. o A relationship set inst_phone, denoting the
association between instructors and the phones that they have.
2. Use of Entity Sets V/s Relationship Sets: It is not always clear whether an object
is best expressed by an entity set or a relationship set. An alternative is to imagine
that there is a course-registration record for each course that each student takes. o
Then, we have an entity set to represent the course-registration record.
3. Binary V/s n-ary Relationship Sets Relationships in databases are often binary.
Some relationships that appear to be non binary could actually be better represented
by several binary relationships. For instance, one could create a ternary relationship
parent, relating a child to his/her mother and father.
4. Placement of Relationship Attributes: The cardinality ratio of a relationship can
affect the placement of relationship attributes. Thus, attributes of one-to-one or one-
to-many relationship sets can be associated with one of the participating entity sets,
rather than with the relationship set.
Advantages
Conceptually it is very simple: ER model is very simple because if we know
relationship between entities and attributes, then we can easily draw an ER diagram.
Better visual representation: ER model is a diagrammatic representation of any
logical structure of database. By seeing ER diagram, we can easily understand
relationship among entities and relationship.
Effective communication tool: It is an effective communication tool for database
designer.
Highly integrated with relational model: ER model can be easily converted into
relational model by simply converting ER model into tables.
Easy conversion to any data model: ER model can be easily converted into another
data model like hierarchical data model, network data model and so on.
Disadvantages
Limited constraints and specification
Loss of information content: Some information be lost or hidden in ER model
12 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Limited relationship representation: ER model represents limited relationship as
compared to another data models like relational model etc.
No representation of data manipulation: It is difficult to show data manipulation in
ER model.
Object Oriented Model :
 Object oriented database systems are alternatives to relational databases and
other database systems. In an object oriented database, information is
represented in the form of objects.
 Object oriented databases are exactly the same as object oriented programming
languages. If we can combine the features of relational model (transaction,
concurrency, recovery) to object oriented databases, the resultant model is called
as object oriented database model.
Advantages:
 Because of its inheritance property, we can re-use the attributes and
functionalities.
 It reduces the cost of maintaining the same data multiple times. Also, this
information is encapsulated and, there is no fear being misused by other objects.
 If we need any new feature we can easily add new class inherited from parent
class and adds new features. Hence it reduces the overhead and maintenance
costs.
13 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
 Because of the above feature, it becomes more flexible in the case of any changes.
Codes are re-used because of inheritance.
 Since each class binds its attributes and its functionality, it is same as
representing the real world object. We can see each object as a real entity. Hence
it is more understandable.
Disadvantages:
 It is not widely developed and complete to use it in the database systems. Hence
it is not accepted by the users.
 It is an approach for solving the requirement. It is not a technology. Hence it fails
to put it in the database management systems.
Basic Building Blocks
The basic building blocks of all data models are entities, attributes, relationships, and
constraints. The entities, attributes, relationships are covered before and let us now
Types of constraints
NOT NULL: NOT NULL constraint makes sure that a column does not hold NULL
value. When we don’t provide value for a particular column while inserting a record
into a table, it takes NULL value by default. By specifying NULL constraint, we can be
sure that a particular column(s) cannot have NULL values.
CREATE TABLE STUDENT(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (25),
PRIMARY KEY (ROLL_NO)
);
14 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
UNIQUE: UNIQUE Constraint enforces a column or set of columns to have unique
values. If a column has a unique constraint, it means that particular column cannot have
duplicate values in a table.
CREATE TABLE STUDENT
(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL UNIQUE,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (35) UNIQUE,
PRIMARY KEY (ROLL_NO)
);
DEFAULT: The DEFAULT constraint provides a default value to a column when there
is no value provided while inserting a record into a table.
CREATE TABLE STUDENT
(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL,
STU_AGE INT NOT NULL,
EXAM_FEE INT DEFAULT 10000,
STU_ADDRESS VARCHAR (35) ,
PRIMARY KEY (ROLL_NO)
);
CHECK: This constraint is used for specifying range of values for a particular column of
a table. When this constraint is being set on a column, it ensures that the specified
column must have the value falling in the specified range.
CREATE TABLE STUDENT
(
ROLL_NO INT NOT NULL CHECK(ROLL_NO >1000),
STU_NAME VARCHAR (35) NOT NULL,
STU_AGE INT NOT NULL,
EXAM_FEE INT DEFAULT 10000,
STU_ADDRESS VARCHAR (35) ,
PRIMARY KEY (ROLL_NO)
);
15 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Key constraints:
PRIMARY KEY: Primary key uniquely identifies each record in a table. It must have
unique values and cannot contain nulls. In the below example the ROLL_NO field is
marked as primary key, that means the ROLL_NO field cannot have duplicate and null
values.
CREATE TABLE STUDENT
(
ROLL_NO INT NOT NULL,
STU_NAME VARCHAR (35) NOT NULL UNIQUE,
STU_AGE INT NOT NULL,
STU_ADDRESS VARCHAR (35) UNIQUE,
PRIMARY KEY (ROLL_NO)
);
FOREIGN KEY: Foreign keys are the columns of a table that points to the primary key
of another table. They act as a cross-reference between tables.
CREATE TABLE ORDERS
(
ID INT NOT NULL,
DATE DATETIME,
CUSTOMER_ID INT references CUSTOMERS(ID),
AMOUNT double,
PRIMARY KEY(ID)
);
16 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Data Model Business Rules:
 Business rules allow the creator to develop relationship participation rules and
constraints and to create a correct data model. They also allow the creators to
understand business processes, and the nature, role and scope of the data.
 They are a communication tool between users and creators, and they also help
standardize the company’s view of the data. It is important to keep in mind that
some business rules cannot be modeled. Business Rules give the proper
classification of entities, attributes, relationships, and constraints.
 The most basic element of a business rule is the language used to express it: Facts
relating terms to each other (relationships and cardinality).Constraints: Every
enterprise constrains behavior in some way, and this is closely related to
constraints on what data may or may not be updated. To prevent a record from
being made is, in many cases, to prevent an action from taking place.
There are four types of Business Rules:
1. Entity Integrity: Each instance if an entity type must have a unique identifier that
is not null.
2. Referential Integrity Constraints: Rules concerning relationship between entity
types.
3. Domain Integrity: Constraints on valid values for attributes.
4. Triggering Operations: Preserves validity of attribute values.
17 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
Chapter 03:
Database design and ER Model: Overview, ER Model, Constraints, ER Diagrams, ERD
Issues, weak entity sets, Codd’s rules, Relational Schemas, Introduction to UML
What is Database Design?
Database design is proposing data according to a database model. The designer
determines what data must be stored and how the data elements interrelate. With this
information, it can begin to fit the data to the database model. Database design
involves classifying data and identifying interrelationships.
Following are inputs required while designing database.
 Determining data to be stored :This process is one which is generally considered
part of requirements analysis, and requires skill on the part of the database
designer to elicit the needed information from those with the domain knowledge.
 Determining data relationships: Once a database designer is aware of the data
which is to be stored within the database, they must then determine where
dependency is within the data.
 Logically structuring data : Once the relationships and dependencies amongst
the various pieces of information have been determined, it is possible to arrange
the data into a logical structure which can then be mapped into the storage
objects supported by the database management system.
 ER diagram (entity-relationship model): Database designs also include ER
(entity-relationship model) diagrams. An ER diagram is a diagram that helps to
design databases in an efficient way.
 Normalization: In the field of relational database design, normalization is a
systematic way of ensuring that a database structure is suitable for general-purpose
querying and free of certain undesirable characteristics—insertion, update, and
deletion anomalies that could lead to loss of data integrity.
Introduction to UML
 UML is a standard language for specifying, visualizing, constructing, and
documenting the artifacts of software systems.UML was created by the Object
Management Group (OMG).
18 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
 UML stands for Unified Modeling Language.UML is different from the other
common programming languages such as C++, Java, COBOL, etc. UML is a
pictorial language used to make software blueprints.
 UML can be described as a general purpose visual modeling language to
visualize, specify, construct, and document software system.
 UML diagrams are not only made for developers but also for business users,
common people, and anybody interested to understand the system. The
system can be a software or non-software system. Thus it must be clear that
UML is not a development method rather it accompanies with processes to
make it a successful system.
 In conclusion, the goal of UML can be defined as a simple modeling
mechanism to model all possible practical systems in today’s complex
environment.
Types of UML Diagram:-
UML Use Case Diagram: Use case diagram is used during the analysis phase of a
project to identify the system functionality. It describes the interaction of people or
external device with the system under design. It doesn't show much detail, but only
summarizes some of the relationships between use cases, actors, and systems.
UML Sequence Diagram: Sequence diagrams are used in the analysis and design
phases. It's an interaction diagram that details how operations are carried out.
Sequence diagram is often used to depict the chronologically-structured event flow
through a use case. It signifies communication relationships between objects; and
what messages trigger those communications. Lifeline represents typical instances of
19 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
the components or classes in your system. Messages are shown as arrows. They can
be complete, lost or found; synchronous or asynchronous; call or signal
UML State-Chart Diagram: State chart diagrams are used to model dynamic nature
of a system. They describe all of the possible states of an object as events occur. So
the most important purpose of State chart diagram is to model life time of an object
from creation to termination.
UML Class Diagram: A UML class diagram is not only used to describe the object
and information structures in an application, but also show the communication with
its users. It provides a wide range of usages; from modeling the static view of an
20 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
application to describing responsibilities for a system. Composition is a special type
of aggregation that denotes a strong ownership.
UML Activity Diagram: The purpose of activity diagram is to describe the procedural
flow of actions as part of a larger activity. It is used to model how activities are
coordinated to provide a service; to show the events needed to achieve some operation,
and to illustrate how the events in a single use case relate to one another.
21 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S
UML Collaboration Diagram: A collaboration diagram is used to describe a
collection of objects that interact to implement some behavior within a context. It's
used to model system functionality, which in specific, visualize the relationship
between objects collaborating to perform a particular task and model the logic of the
implementation for a complex operation.

More Related Content

What's hot

2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architectureKumar
 
Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Burhan Chaudhry
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMSYouQue ™
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management SystemParam Radadiya
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization TechniquesNishant Munjal
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersOXUS 20
 
Relational algebra in DBMS
Relational algebra in DBMSRelational algebra in DBMS
Relational algebra in DBMSArafat Hossan
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database usersKumar
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraintsmadhav bansal
 
Importance of Normalization
Importance of NormalizationImportance of Normalization
Importance of NormalizationShwe Yee
 

What's hot (20)

RDBMS concepts
RDBMS conceptsRDBMS concepts
RDBMS concepts
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
 
Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207Ch01 database-conceptsppt4207
Ch01 database-conceptsppt4207
 
Introduction of DBMS
Introduction of DBMSIntroduction of DBMS
Introduction of DBMS
 
Type of Database Management System
Type of Database Management SystemType of Database Management System
Type of Database Management System
 
Dbms models
Dbms modelsDbms models
Dbms models
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Data models
Data modelsData models
Data models
 
Fundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and AnswersFundamentals of Database Systems Questions and Answers
Fundamentals of Database Systems Questions and Answers
 
dbms notes.ppt
dbms notes.pptdbms notes.ppt
dbms notes.ppt
 
Relational algebra in DBMS
Relational algebra in DBMSRelational algebra in DBMS
Relational algebra in DBMS
 
Relational model
Relational modelRelational model
Relational model
 
DBMS SECURITY
DBMS SECURITYDBMS SECURITY
DBMS SECURITY
 
Database concepts
Database conceptsDatabase concepts
Database concepts
 
1 introduction databases and database users
1 introduction databases and database users1 introduction databases and database users
1 introduction databases and database users
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Importance of Normalization
Importance of NormalizationImportance of Normalization
Importance of Normalization
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 

Similar to Data Models & Introduction to UML

Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxnirajsharmapuneiat
 
Unit1 rdbms study_materials
Unit1 rdbms study_materialsUnit1 rdbms study_materials
Unit1 rdbms study_materialsgayaramesh
 
Unit1 rdbms study_materials-converted (1) (1)
Unit1 rdbms study_materials-converted (1) (1)Unit1 rdbms study_materials-converted (1) (1)
Unit1 rdbms study_materials-converted (1) (1)gayaramesh
 
DBMS-7.pptx
DBMS-7.pptxDBMS-7.pptx
DBMS-7.pptxkingVox
 
DBMS-2.pptx
DBMS-2.pptxDBMS-2.pptx
DBMS-2.pptxkingVox
 
Geographic Information System unit 2
Geographic Information System unit 2Geographic Information System unit 2
Geographic Information System unit 2sridevi5983
 
Geographic Information systems
Geographic Information systemsGeographic Information systems
Geographic Information systemsRajalakshmiS34
 
Data resource management
Data resource managementData resource management
Data resource managementNirajan Silwal
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxJasmineMichael1
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modelingoudesign
 
Database System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptxDatabase System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptxKoteswari Kasireddy
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
chapter-13-database-concepts.pdf
chapter-13-database-concepts.pdfchapter-13-database-concepts.pdf
chapter-13-database-concepts.pdfstudy material
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbmsAnjaan Gajendra
 

Similar to Data Models & Introduction to UML (20)

Unit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptxUnit-1-DBMS-SUN-4 everything you need to know.pptx
Unit-1-DBMS-SUN-4 everything you need to know.pptx
 
Unit1 rdbms study_materials
Unit1 rdbms study_materialsUnit1 rdbms study_materials
Unit1 rdbms study_materials
 
Unit1 rdbms study_materials-converted (1) (1)
Unit1 rdbms study_materials-converted (1) (1)Unit1 rdbms study_materials-converted (1) (1)
Unit1 rdbms study_materials-converted (1) (1)
 
DBMS Part-2.pptx
DBMS Part-2.pptxDBMS Part-2.pptx
DBMS Part-2.pptx
 
database
databasedatabase
database
 
DBMS-7.pptx
DBMS-7.pptxDBMS-7.pptx
DBMS-7.pptx
 
DBMS-2.pptx
DBMS-2.pptxDBMS-2.pptx
DBMS-2.pptx
 
Geographic Information System unit 2
Geographic Information System unit 2Geographic Information System unit 2
Geographic Information System unit 2
 
Spatial Data Models
Spatial Data Models Spatial Data Models
Spatial Data Models
 
Geographic Information systems
Geographic Information systemsGeographic Information systems
Geographic Information systems
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
DBMS unit-2.pdf
DBMS unit-2.pdfDBMS unit-2.pdf
DBMS unit-2.pdf
 
Data resource management
Data resource managementData resource management
Data resource management
 
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptxDATA MODEL PRESENTATION UNIT I-BCA I.pptx
DATA MODEL PRESENTATION UNIT I-BCA I.pptx
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
 
Database System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptxDatabase System Concepts AND architecture [Autosaved].pptx
Database System Concepts AND architecture [Autosaved].pptx
 
Dbms 2: Data Model
Dbms 2: Data ModelDbms 2: Data Model
Dbms 2: Data Model
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
chapter-13-database-concepts.pdf
chapter-13-database-concepts.pdfchapter-13-database-concepts.pdf
chapter-13-database-concepts.pdf
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

Data Models & Introduction to UML

  • 1. 1 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Chapter 02: Data Models: The importance of data models, Basic building blocks, Business rules, The evolution of data models, Degrees of data abstraction. What is Data Model?  In general terms, a model is an abstraction of a more complex real-world object or event. Data models define how the logical structure of a database is modeled.  Data Models are fundamental entities to introduce abstraction in a DBMS.  Data models define how data is connected to each other and how they are processed and stored inside the system. A data model is a relatively simple representation, usually graphical, of more complex real-world data structures. Importance of data Models  Data constitute the most basic information units employed by a system. Applications are created to manage data and to help transform data into information. But data are viewed in different ways by different people. So that there is a huge importance of data modeling in DBMS.  Data models can facilitate interaction among the designer, the applications programmer, and the end user.  A well-developed data model can even foster improved understanding of the organization for which the database design is developed. In short, data models are a communication tool.  The importance of data modeling cannot be overstated. Data constitutes the most basic information employed by a system. Applications are created to manage data and to help transform data into information, but data is viewed in different ways by different people.
  • 2. 2 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Hierarchical Model  A hierarchical database model is a data model in which the data is organized into a tree-like structure. The data is stored as records which are connected to one another through links.  A record is a collection of fields, with each field containing only one value. The entity type of a record defines which fields the record contains.  A record in the hierarchical database model corresponds to a row (or tuples) in the relational database model and an entity type corresponds to a table (or relation).  The hierarchical database model mandates that each child record has only one parent, whereas each parent record can have one or more child records.
  • 3. 3 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Advantages :  Easy to understand  Performance is better than relational data model Disadvantages :  Difficult to access values at lower level  This model may not be flexible to accommodate the dynamic needs of an organization  Deletion of parent node result in deletion of child node forcefully Network Model  The network model is a database model conceived as a flexible way of representing objects and their relationships. Its distinguishing feature is that the schema, viewed as a graph in which object types are nodes and relationship types are arcs.  While the hierarchical database model structures data as a tree of records, with each record having one parent record and many children, the network model allows each record to have multiple parent and child records, forming a generalized graph structure.
  • 4. 4 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Advantages:  Easy access to data  Highly Flexible & Efficient  This model can be applied to real world problems that require routine transactions. Disadvantages:  Complex to design and develop.  Extra memory is required for storage of pointers  Performance is inflexible and difficult to use.  Operation and maintenance are time consuming and expensive for large databases. Relational Model  It represents the database as a collection of relations. A relation is nothing but a table of values. Every row in the table represents a collection of related data values. These rows in the table denote a real-world entity or relationship.  The most popular data model in DBMS is the Relational Model. This model is based on first-order predicate logic and defines a table as an n-ary relation.  The table name and column names are helpful to interpret the meaning of values in each row. The data are represented as a set of relations. In the relational model, data are stored as tables. However, the physical storage of the data is independent of the way the data are logically organized. Some popular Relational Database management systems are:  Oracle and RDB – Oracle  SQL Server and Access - Microsoft
  • 5. 5 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Characteristics:  Data is stored in tables called relations.  Relations can be normalized.  In normalized relations, values saved are atomic values.  Each row in a relation contains a unique value.  Reflects real-world structure of the problem  Can represent all expected data over time  Avoids redundant storage of data items  Provides efficient access to data  Supports the maintenance of data integrity over time  Clean, consistent, and easy to understand  Each column in a relation contains values from a same domain. Advantages:  Easy to use and understand and very flexible.  Provides excellent support for adhoc queries.  Users need not consider issues such as storage structure and access strategy.  Specify control and authorization can be implemented more easily.  Data independence is achieved more easily with normalization structure used in a relational database. Disadvantages–  For large databases, the performance in responding to queries is definitely degraded.  The processing requirements need to construct the indexes. So, the index position of the file must be created and maintained along with the file records themselves. The file index must be searched sequentially before the actual file records are obtained. This is time consuming.
  • 6. 6 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Entity Relationship Model  An Entity–relationship model (ER model) describes the structure of a database with the help of a diagram, which is known as Entity Relationship Diagram (ER Diagram).  An ER diagram shows the relationship among entity sets. An entity set is a group of similar entities and these entities can have attributes.  In terms of DBMS, an entity is a table or attribute of a table in a database, so by showing relationships among tables and their attributes, the ER diagram shows the complete logical structure of a database.  Let's have a look at a simple ER diagram to understand this concept. In the following diagram we have two entities Student and College and their relationship. The relationship between Student and College is many to one as a college can have many students however a student cannot study in multiple colleges at the same time. Student entity has attributes such as Stu_Id, Stu_Name & Stu_Addr and College entity has attributes such as Col_ID & Col_Name.
  • 7. 7 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Entity  An entity is an object or component of data. An entity is represented as a rectangle in an ER diagram. For example: In the following ER diagram we have two entities Student and College and these two entities have many to one relationship as many students study in a single college. We will read more about relationships later, for now focus on entities.  Weak Entity: An entity that cannot be uniquely identified by its own attributes and relies on the relationship with another entity is called a weak entity. The weak entity is represented by a double rectangle.  Strong Entity: The Strong Entity is the one whose existence does not depend on the existence of any other entity in a schema. It is denoted by a single rectangle. A strong entity always has the primary key in the set of attributes that describes the strong entity. It indicates that each entity in a strong entity set can be uniquely identified. For example – a bank account cannot be uniquely identified without knowing the bank to which the account belongs, so a bank account is a weak entity and a bank is a strong entity as it is uniquely identified by its bank number/IFSC. 2. Attribute An attribute describes the property of an entity. An attribute is represented as Oval in an ER diagram. There are four types of attributes: 1. Key attribute 2. Composite attribute 3. Multivalued attribute 4. Derived attribute Key attribute: A key attribute can uniquely identify an entity from an entity set. For example, a student roll number can uniquely identify a student from a set of students. Key attribute is represented by oval the same as other attributes however the text of key attribute is underlined.
  • 8. 8 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Composite attribute: An attribute that is a combination of other attributes is known as a composite attribute. For example, in a student entity, the student address is a composite attribute as an address is composed of other attributes such as pin code, state, country. Your name can be also termed as composite attribute which has FNAME MNAME LNAME Multivalued attribute: An attribute that can hold multiple values is known as multivalued attribute. It is represented with double ovals in an ER Diagram. For example – A person can have more than one phone number so the phone number attribute is multivalued. Derived attribute: A derived attribute is one whose value is dynamic and derived from another attribute. It is represented by a dashed oval in an ER Diagram. For example – Person age is a derived attribute as it changes over time and can be derived from another attribute (Date of birth). Relationship  A relationship is represented by diamond shape in ER diagram; it shows the relationship among entities. When relationships are mapped with entities in different ways then it is also termed as Mapping Cardinalities that represents association or relationship between two entities.  There are four types of cardinalities: 1. One to One 2. One to Many 3. Many to One 4. Many to Many One to One Relationship :When a single instance of an entity is associated with a single instance of another entity then it is called one to one relationship. For example, a person has only one passport and a passport is given to one person.
  • 9. 9 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S One to Many Relationship:When a single instance of an entity is associated with more than one instances of another entity then it is called one to many relationship. For example – a customer can place many orders but a order cannot be placed by many customers. Many to One Relationship: When more than one instances of an entity is associated with a single instance of another entity then it is called many to one relationship. For example – many students can study in a single college but a student cannot study in many colleges at the same time. Many to Many Relationships: When more than one instance of an entity is associated with more than one instance of another entity then it is called many to many relationship. For example, a student can be assigned too many projects and a project can be assigned to many students. Total Participation of an Entity set: A Total participation of an entity set represents that each entity in entity set must have at least one relationship in a relationship set. For example: In the below diagram each college must have at-least one associated Student. it is denoted using double lines.
  • 10. 10 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Partial Participation- It specifies that each entity in the entity set may or may not participate in the relationship instance in that relationship set. That is why, it is also called as optional participation. Partial participation is represented using a single line between the entity set and relationship set. ERD NOTATIONS:
  • 11. 11 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S ERD ISSUES 1. Use of Entity Sets V/s Attributes : Consider the entity set instructor with the additional attribute phone number. It can easily be argued that a phone is an entity in its own right with attributes phone number and location; the location may be the office or home where the phone is located, with mobile (cell) phones perhaps represented by the value “mobile.” If we take this point of view, we do not add the attribute phone number to the instructor. Rather, we create: A phone entity set with attributes phone number and location. o A relationship set inst_phone, denoting the association between instructors and the phones that they have. 2. Use of Entity Sets V/s Relationship Sets: It is not always clear whether an object is best expressed by an entity set or a relationship set. An alternative is to imagine that there is a course-registration record for each course that each student takes. o Then, we have an entity set to represent the course-registration record. 3. Binary V/s n-ary Relationship Sets Relationships in databases are often binary. Some relationships that appear to be non binary could actually be better represented by several binary relationships. For instance, one could create a ternary relationship parent, relating a child to his/her mother and father. 4. Placement of Relationship Attributes: The cardinality ratio of a relationship can affect the placement of relationship attributes. Thus, attributes of one-to-one or one- to-many relationship sets can be associated with one of the participating entity sets, rather than with the relationship set. Advantages Conceptually it is very simple: ER model is very simple because if we know relationship between entities and attributes, then we can easily draw an ER diagram. Better visual representation: ER model is a diagrammatic representation of any logical structure of database. By seeing ER diagram, we can easily understand relationship among entities and relationship. Effective communication tool: It is an effective communication tool for database designer. Highly integrated with relational model: ER model can be easily converted into relational model by simply converting ER model into tables. Easy conversion to any data model: ER model can be easily converted into another data model like hierarchical data model, network data model and so on. Disadvantages Limited constraints and specification Loss of information content: Some information be lost or hidden in ER model
  • 12. 12 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Limited relationship representation: ER model represents limited relationship as compared to another data models like relational model etc. No representation of data manipulation: It is difficult to show data manipulation in ER model. Object Oriented Model :  Object oriented database systems are alternatives to relational databases and other database systems. In an object oriented database, information is represented in the form of objects.  Object oriented databases are exactly the same as object oriented programming languages. If we can combine the features of relational model (transaction, concurrency, recovery) to object oriented databases, the resultant model is called as object oriented database model. Advantages:  Because of its inheritance property, we can re-use the attributes and functionalities.  It reduces the cost of maintaining the same data multiple times. Also, this information is encapsulated and, there is no fear being misused by other objects.  If we need any new feature we can easily add new class inherited from parent class and adds new features. Hence it reduces the overhead and maintenance costs.
  • 13. 13 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S  Because of the above feature, it becomes more flexible in the case of any changes. Codes are re-used because of inheritance.  Since each class binds its attributes and its functionality, it is same as representing the real world object. We can see each object as a real entity. Hence it is more understandable. Disadvantages:  It is not widely developed and complete to use it in the database systems. Hence it is not accepted by the users.  It is an approach for solving the requirement. It is not a technology. Hence it fails to put it in the database management systems. Basic Building Blocks The basic building blocks of all data models are entities, attributes, relationships, and constraints. The entities, attributes, relationships are covered before and let us now Types of constraints NOT NULL: NOT NULL constraint makes sure that a column does not hold NULL value. When we don’t provide value for a particular column while inserting a record into a table, it takes NULL value by default. By specifying NULL constraint, we can be sure that a particular column(s) cannot have NULL values. CREATE TABLE STUDENT( ROLL_NO INT NOT NULL, STU_NAME VARCHAR (35) NOT NULL, STU_AGE INT NOT NULL, STU_ADDRESS VARCHAR (25), PRIMARY KEY (ROLL_NO) );
  • 14. 14 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S UNIQUE: UNIQUE Constraint enforces a column or set of columns to have unique values. If a column has a unique constraint, it means that particular column cannot have duplicate values in a table. CREATE TABLE STUDENT ( ROLL_NO INT NOT NULL, STU_NAME VARCHAR (35) NOT NULL UNIQUE, STU_AGE INT NOT NULL, STU_ADDRESS VARCHAR (35) UNIQUE, PRIMARY KEY (ROLL_NO) ); DEFAULT: The DEFAULT constraint provides a default value to a column when there is no value provided while inserting a record into a table. CREATE TABLE STUDENT ( ROLL_NO INT NOT NULL, STU_NAME VARCHAR (35) NOT NULL, STU_AGE INT NOT NULL, EXAM_FEE INT DEFAULT 10000, STU_ADDRESS VARCHAR (35) , PRIMARY KEY (ROLL_NO) ); CHECK: This constraint is used for specifying range of values for a particular column of a table. When this constraint is being set on a column, it ensures that the specified column must have the value falling in the specified range. CREATE TABLE STUDENT ( ROLL_NO INT NOT NULL CHECK(ROLL_NO >1000), STU_NAME VARCHAR (35) NOT NULL, STU_AGE INT NOT NULL, EXAM_FEE INT DEFAULT 10000, STU_ADDRESS VARCHAR (35) , PRIMARY KEY (ROLL_NO) );
  • 15. 15 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Key constraints: PRIMARY KEY: Primary key uniquely identifies each record in a table. It must have unique values and cannot contain nulls. In the below example the ROLL_NO field is marked as primary key, that means the ROLL_NO field cannot have duplicate and null values. CREATE TABLE STUDENT ( ROLL_NO INT NOT NULL, STU_NAME VARCHAR (35) NOT NULL UNIQUE, STU_AGE INT NOT NULL, STU_ADDRESS VARCHAR (35) UNIQUE, PRIMARY KEY (ROLL_NO) ); FOREIGN KEY: Foreign keys are the columns of a table that points to the primary key of another table. They act as a cross-reference between tables. CREATE TABLE ORDERS ( ID INT NOT NULL, DATE DATETIME, CUSTOMER_ID INT references CUSTOMERS(ID), AMOUNT double, PRIMARY KEY(ID) );
  • 16. 16 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Data Model Business Rules:  Business rules allow the creator to develop relationship participation rules and constraints and to create a correct data model. They also allow the creators to understand business processes, and the nature, role and scope of the data.  They are a communication tool between users and creators, and they also help standardize the company’s view of the data. It is important to keep in mind that some business rules cannot be modeled. Business Rules give the proper classification of entities, attributes, relationships, and constraints.  The most basic element of a business rule is the language used to express it: Facts relating terms to each other (relationships and cardinality).Constraints: Every enterprise constrains behavior in some way, and this is closely related to constraints on what data may or may not be updated. To prevent a record from being made is, in many cases, to prevent an action from taking place. There are four types of Business Rules: 1. Entity Integrity: Each instance if an entity type must have a unique identifier that is not null. 2. Referential Integrity Constraints: Rules concerning relationship between entity types. 3. Domain Integrity: Constraints on valid values for attributes. 4. Triggering Operations: Preserves validity of attribute values.
  • 17. 17 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S Chapter 03: Database design and ER Model: Overview, ER Model, Constraints, ER Diagrams, ERD Issues, weak entity sets, Codd’s rules, Relational Schemas, Introduction to UML What is Database Design? Database design is proposing data according to a database model. The designer determines what data must be stored and how the data elements interrelate. With this information, it can begin to fit the data to the database model. Database design involves classifying data and identifying interrelationships. Following are inputs required while designing database.  Determining data to be stored :This process is one which is generally considered part of requirements analysis, and requires skill on the part of the database designer to elicit the needed information from those with the domain knowledge.  Determining data relationships: Once a database designer is aware of the data which is to be stored within the database, they must then determine where dependency is within the data.  Logically structuring data : Once the relationships and dependencies amongst the various pieces of information have been determined, it is possible to arrange the data into a logical structure which can then be mapped into the storage objects supported by the database management system.  ER diagram (entity-relationship model): Database designs also include ER (entity-relationship model) diagrams. An ER diagram is a diagram that helps to design databases in an efficient way.  Normalization: In the field of relational database design, normalization is a systematic way of ensuring that a database structure is suitable for general-purpose querying and free of certain undesirable characteristics—insertion, update, and deletion anomalies that could lead to loss of data integrity. Introduction to UML  UML is a standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems.UML was created by the Object Management Group (OMG).
  • 18. 18 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S  UML stands for Unified Modeling Language.UML is different from the other common programming languages such as C++, Java, COBOL, etc. UML is a pictorial language used to make software blueprints.  UML can be described as a general purpose visual modeling language to visualize, specify, construct, and document software system.  UML diagrams are not only made for developers but also for business users, common people, and anybody interested to understand the system. The system can be a software or non-software system. Thus it must be clear that UML is not a development method rather it accompanies with processes to make it a successful system.  In conclusion, the goal of UML can be defined as a simple modeling mechanism to model all possible practical systems in today’s complex environment. Types of UML Diagram:- UML Use Case Diagram: Use case diagram is used during the analysis phase of a project to identify the system functionality. It describes the interaction of people or external device with the system under design. It doesn't show much detail, but only summarizes some of the relationships between use cases, actors, and systems. UML Sequence Diagram: Sequence diagrams are used in the analysis and design phases. It's an interaction diagram that details how operations are carried out. Sequence diagram is often used to depict the chronologically-structured event flow through a use case. It signifies communication relationships between objects; and what messages trigger those communications. Lifeline represents typical instances of
  • 19. 19 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S the components or classes in your system. Messages are shown as arrows. They can be complete, lost or found; synchronous or asynchronous; call or signal UML State-Chart Diagram: State chart diagrams are used to model dynamic nature of a system. They describe all of the possible states of an object as events occur. So the most important purpose of State chart diagram is to model life time of an object from creation to termination. UML Class Diagram: A UML class diagram is not only used to describe the object and information structures in an application, but also show the communication with its users. It provides a wide range of usages; from modeling the static view of an
  • 20. 20 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S application to describing responsibilities for a system. Composition is a special type of aggregation that denotes a strong ownership. UML Activity Diagram: The purpose of activity diagram is to describe the procedural flow of actions as part of a larger activity. It is used to model how activities are coordinated to provide a service; to show the events needed to achieve some operation, and to illustrate how the events in a single use case relate to one another.
  • 21. 21 | P a g e S Y B S C I T - S E M I I I – I N T R O D U C T I O N T O D B M S UML Collaboration Diagram: A collaboration diagram is used to describe a collection of objects that interact to implement some behavior within a context. It's used to model system functionality, which in specific, visualize the relationship between objects collaborating to perform a particular task and model the logic of the implementation for a complex operation.