Professional Documents
Culture Documents
The data requirements is a detailed and complete form of data requirements are
used as a source of database design.
In parallel with specifying the data requirements, it is useful to specify the
known functional requirements of the application. Functional requirements
consist of user defined operations that will be applied to the database,
including retrievals and updates.
Functional requirements can be documented using diagrams such as sequence
diagrams, data flow diagrams, scenarios, etc.
Step 2: Conceptual Design: Once all the requirements have been collected and
analyzed, the next step is to create a conceptual schema for the database,
using a high level conceptual data model. This phase is called conceptual
design (Conceptual design is also called as conceptual schema).
Conceptual schema: brief description of data requirements of the users and
includes a detailed description of the entity types, relationships and
constraints. Conceptual schema concepts do not include implementation details;
therefore the end users easily understand them, and they can be used as a
communication tool. The conceptual schema is used to ensure all user
requirements are met, and they do not conflict.
Entity
Attribute: Attributes are the descriptive properties which are owned by each
entity (An attribute is a real world property or characteristic of an entity).
Attribute is the name of the column. An entity may contain any number of
attributes. One of the attributes is considered as the primary key. In an
Entity-Relation model, attributes are represented in an oval or ellipse
(elliptical) symbol. Every ellipse represents one attribute and is directly
connected to its entity (rectangle).
For example: In Bank database, Customer is considered as one entity and
customer entity describes various data elements (data field, a field, a data
Entity Types: Entities are mainly classified into two types. There are,
1. Strong Entity Types
2. Weak Entity Types
Some other types of entities are,
1. Recursive Entity Types
2. Composite Entity Types or Associative Entity Types
3. SuperType and SubType Entities
Strong Entity Type:
Strong entity is the entity which has a key attribute (primary
key) in its attribute list to uniquely identify each entity. The strong entity type
entity.
Strong Entity
The ROLLNO in Student entity will identify the each student uniquely. So,
ROLLNO is set to be the Primary Key of the STUDENT entity, & Hence STUDENT is
a strong entity type because has its own key attribute ROLLNO.
Weak Entity:
Entity type doesn’t have any key attribute or Primary Key of its
own is called weak entity Type. Weak entity depends on other strong entity via
foreign key. A weak Entity is represented using double rectangular boxes.
Weak Entity
Children Entity is depending upon Strong Entity Employee (as it has a unique
ID named SSN). The relationship is established to associate children with
their parents for insurance coverage.
Recursive Entity:
If a relation exists between the same entities, then such
entities are called as recursive entity. For example, mapping between manager
and employee is recursive entity. Here manager is mapped to the same entity
Employee. HOD of the department is another example of having recursive entity.
Example: Any manufactured product can have only one serial no, but the single
valued attribute cannot be simple valued attribute because it can be sub
are many distinct values entered for it in the same column of the table) then it is
For example, each user can have several different hobbies, therefore the
“hobby” can be considered as a multivalued attribute for the “user”
entity:
For example, the Address attribute consists of several domains such as house
number, street number, city, country, etc.
Derived attribute: Derived attributes are the attributes that do not exist in
the physical database (The derived attribute may or may not be physically
stored in the database), but their values are derived from other attributes
present in the database.
For example, having given the price excluding VAT and the VAT rate, we can
calculate the price including VAT:
Key Attribute:
It is an attribute that has primary key to distinct value for
each entity/element in an entity set. The name of a key attribute is
underscored
For example, since the Vehicle Identification Number (VIN) is a unique code
used to identify individual vehicles (no two vehicles have the same VIN),
“VIN” can be considered as the key attribute for the “CAR” entity:
Non Key Attributes: These are attributes other than candidate key attributes
in a table. (Excluding the candidate key attributes in an entity set are the
non key attributes).
Example: First name of a student or employee is a non-key attribute as it does
not represent main characteristic of an entity.
Some entity types have more than one key attribute. For example, each of
the Vehicle_id and Registration attributes of the entity type CAR is a key in
its own right.
Value sets (Domains) of Attributes: A set of values that may be assigned to
the attributes of each individual entity, in an entity set is called the value
set or domain.
Consider the following diagram that shows two entity types (Department and
Instructor) and the concept (a relationship) that instructors work in
departments. This relationship involves two entity types and is referred to as
a binary relationship.
Unary Relationship:
When there is only ONE entity set participating in a
relation, An entity type linked with itself that type of relationship is
called as unary relationship. Unary relationship is also called as
recursive relationship.
Binary Relationship:
When there are TWO entities set participating in a
relation, a one Entity type linked with another entity type that type of
relationship is called as binary relationship. The degree of binary
relationship is 2.
For example, Student is enrolled in Course.
Ternary Relationship:
A relationship exists when three entities are associated
(connected) is called ternary relationship.
N-ary Relationship:
When there are n entities set participating in a
relation, the relationship is called as n-ary relationship.
The most common relationship in ER diagram is Binary Relationship.
One can think of an attribute called Department of the EMPLOYEE entity type,
where the value of Department for each EMPLOYEE entity is (a reference to) the
DEPARTMENT entity for which that employee works. Hence, the value set for this
Department attribute is the set of all
DEPARTMENT entities, which is the DEPARTMENT entity set. This is what we did
in Figure 7.8 when we specified the initial design of the entity type EMPLOYEE
for the COMPANY database. However, when we think of a binary relationship as
an attribute, we always have two options. In this example, the alternative is
to think of a multivalued attribute Employee of the entity type DEPARTMENT
whose values for each DEPARTMENT entity is the set of EMPLOYEE entities who
work for that department.
The value set of this Employee attribute is the power set of the EMPLOYEE
entity set. Either of these two attributes—Department of EMPLOYEE or Employee
of DEPARTMENT—can represent the WORKS_FOR relationship type. If both are
represented, they are constrained to be inverses of each other.8
Role Names:
Each entity type that participates in a relationship type plays a
particular role in the relationship. The role name signify the role that a
participating entity from the entity type plays in each relationship instance,
and helps to explain what the relationship means.
Role names are not technically necessary in relationship types where all the
participating entity types are distinct, since each participating entity type
name can be used as the role name.However, in some cases the same entity type
participates more than once in a relationship type in different roles. In such
cases the role name becomes essential for distinguishing the meaning of the
role that each participating entity plays. Such relationship types are called
recursive relationships.
For example:- in the WORKS_FOR relationship type, EMPLOYEE plays the role of
employee or worker and DEPARTMENT plays the role of department or employer.
However, in some cases the same entity type participates more than once in a
relationship type in different roles. In such cases the role name becomes
essential for distinguishing the meaning of the role that each participating
entity plays. Such relationship types are called recursive relationships.
It is about the maximum number of entities of one entity set that are
associated with the maximum number of entities of the other entity set.
For example:
Let us assume a student entity set (student’s information) and course entity
set (courses that are registered by a student).
One-to-one relationship:
If an entity [a record] of one
entity set A is associated with at most one entity in entity set B and entity
in entity set B is associated with at most one entity in entity set A. this
Example:
Let us assume a database for Airline Reservation System. Further assume that
there are two entity sets Passengers and Boarding-Pass represent the passenger
details and the flight tickets details respectively. If it is decided to issue
each passenger a boarding pass, then the relationship between the entity sets
Passengers and Boarding-Pass will be One-to-one.
As shown in the figure below, each passenger is allotted only one seat. Each
passenger entity is associated with exactly one Boarding_Pass entity.
Look at the ERD carefully. Arrow head is used in either side of the
relationship Given. It indicates, one passenger for one boarding_pass, also
one boarding_pass for one passenger.
Some other examples:
A country has only one capital city, and a capital city is the capital of only
one country.
Each student fills one seat and one seat is assigned to only one
student.
The above example describes that one student can enroll only for one course
and a course will also have only one Student. This is not what you will
usually see in real-world relationships.
When we would say the relationship is one-to-one?
Assume two entity sets A and B. The
relationship between A and B is one-to-one if and only if “an entity in A is
associated with only one entity (record) in B and an entity in B is associated
with only one entity (record) in A”.
If we put in simpler terms, entity set B is the one side for A and entity set
A is the one side for B.
One-to-Many relationship:
If an entity [a record] of one
entity set is associated with zero or more entities of the other entity set,
then the cardinality ratio is said to be one-to-many from one side entity set
to the many side entity set.
One entity from entity set A can be associated with more than one entities of
entity set B however an entity from entity set B, can be associated with at
most one entity.
Example:
1 student can opt for many courses, but a course can only
have 1 student. Sounds weird! This is how it is.
Example:
Let us assume a database for Airline Reservation System.
Further assume that there are two entity sets Flights and Flight_Attendants to
model the flight details and the flight attendants details respectively. If
one flight can have many attendants, then this relationship can be modeled as
one-to-many from Flight to Flight_Attendants.
When we say that the relationship type is either one-to-many or many-to-one,
it is always important to say which side is one and which side is many to
avoid ambiguity.
This can be read as, one flight has many flight attendants and one flight
attendant is attending only one flight.
When we would say the relationship is one-to-many?
Example:
Student enrolls for only one Course but a Course can have
many Students.
Example:
Teachers teach students. In any school or college many
teachers are teaching many students. This can be considered as a two way
many-to-many relationship. This can be expressed in the following diagram as:
The above diagram represents that one student can enroll for more than one
courses. And a course can have more than 1 student enrolled in it.
Total Participation:
Relationship types can also have attributes, similar to those of entity types.
For example:-
To record the number of hours per week that an employee
works on a particular project, we can include an attribute Hours for the
WORKS_ON relationship type.
After specifying the above six relationship types, we remove from the entity
types in Figure 7.8 all attributes that have been refined into relationships.
These include Manager and Manager_start_date from DEPARTMENT;
Controlling_department from PROJECT; Department, Supervisor, and Works_on from
EMPLOYEE; and Employee from DEPENDENT. It is important to have the least
possible redundancy when we design the conceptual schema of a database.
Relationship
Name Description
Symbol
ERD attribute symbols: ERD attributes are characteristics of the entity that
help users to better understand the database. Attributes are included to
include details of the various entities that are highlighted in a conceptual
ER diagram.
Attribute
Name Description
Symbol
Relationships
Symbol Meaning
Relationships (Cardinality and Modality)
Zero or One
One or More
Zero or More
3. Add attributes for entities: Next, determine the attributes (or column
names) your entities will have. For the customer, we’ll need to know
name, customer id, their phone number, where they live and the amount they
need to pay. Go through each of your entities and determine what
attributes they need to have. Give meaningful attribute names so they can
be understood easily.
Next, consider the attributes that you need to describe each entity. These are
drawn and labeled inside ovals. Connect these to the relevant entity and
The final step for this simple ER diagram is to define the amount of data that
will come from each entity. Cardinality is a simple notation that quickly
tells your ERD reader whether there are zero, one, many, or some combination