Chapter One
Chapter One
This unit is developed to provide you the necessary information regarding the following
content coverage and topics
The conceptual or scoping model defines the boundaries of the system (i.e., what is in scope and what is out of
scope). It identifies:
Events outside the system that cause the system to react,
Actors outside the system that interact with the system,
Information that flows between the system and the actors outside the system,
Major functions included in the system,
User population.
I. Clarify System Boundaries
In addition to the scope, it is important that the system boundaries are clearly understood. The boundaries identify
where the system to be sized starts and ends. The sizing should include everything for which the team is
responsible.
A scope of a system is identified based on the following
Databases
Applications
Servers
Operating systems
Gateways
Application service provider and
ISP (Internet service provider)
Example: The diagram below shows a conceptual model with three entity types: Book, Publisher, andAuthor:
Customer: the set of all people having an account at the bank. Attributes are ID, name, Gender,
Gender and Phone-number.
Classification of Entity:
a. Strong Entity: An entity set that has a primary key is termed as strong entity.
b. Weak Entity: an entity set that does not have sufficient attributes to form a primary key. The existence
of a weak entity depends on the existence of stored entity. The discriminator (partial key) is used to
identify other attributes of a weak entity set.
c. Recursive Entity: is one in which a relation can exist between occurrences of the same entity set.
This occurs in a unary relationship.
d. Composite Entities: If a Many to Many relationship exist we must create a bridge entity to convert
into 1 to many. Bridge entity composed of the primary keys of each of the entities to be connected.
The bridge entity is known as a composite entity.
B. Attribute
A factor/property/characteristic that describes an entity
In a database management system (DBMS), an attribute may describe a component of the database, such
as a table or a field
Example: (Colour: attribute of your hair/skin/cloth) Employee’s name, age, address, salary and job:
attribute of Employee, etc.
Types of Attributes
a. Simple and Composite Attribute
Simple attribute: consist of a single atomic value that can’t be subdivided. (For example, age, sex
etc.).
Composite attribute: can be further subdivided. (E.g.,ADDRESS can be subdivided into city, Sub-
city, Woreda, region, House No., etc.)
b. Single Valued and Multi Valued attribute
Single valued: can have only one or a single value. For example, a person can have only one 'date of
birth', 'age', etc. But it can be simple or composite attribute. Example: 'date of birth' is a composite
attribute; 'age' is a simple attribute. But both are single valued attributes.
Multi-valued: can have multiple values. For instance, a person may have multiple phone numbers,
multiple degrees etc. Multi-valued attributes are shown by a double line connecting to the entity in the
ER diagram.
c. Stored and Derived Attributes
Stored attribute: supplies a value to the related attribute. (e.g., 'Date of birth')
Derived attribute: the value is derived from the stored attribute. (e.g., the value of 'AGE' can be
derived by subtracting the 'Date of Birth'(DOB) from the current date.
d. Complex Attribute: attribute that is both composite and multi valued. (e.g., Phone no)
2. Selecting Attributes for Entities: choose ones that have the following qualities:
Significant: Include only attributes that are useful to the database users.
Direct: not derived. Derived data complicates the maintenance of a database.
Non-decomposable: An attribute can contain only single values, never lists or repeating groups.
Composite values must be separated into individual attributes.
Contain data of the same type: For example, you would want to enter only date values in a birthday
attribute, not names or telephone numbers.
Entity Key
A property or a set of properties of an entity type that are used to determine identity.
Value of entity key must uniquely identify an entity type instance within an entity set.
The properties that make up an entity key should be chosen to guarantee uniqueness of instances in an
entity set.
Requirements of entity key:
No two entity keys within an entity set can be identical. That is, for any two entities within an entity
set, the values for all of the properties that constitute a key can’t be the same.
An entity key must consist of a set of non-null, immutable, primitive type properties.
The properties that make up an entity key can’t change. You cannot allow more than one possible
entity key for a given entity type; surrogate keys aren’t supported.
Types of keys
a. Super/Candidate Key: is a field or combination of fields, can act as a primary key for a table to
uniquely identify each record. Every entity in relational database must have at least one candidate key
but it is possible to have two or more. (Example: social security number, employee number or driver
license number may identify an employee. All of them are considered candidate keys)
b. Primary Key: is an attribute or set of attributes that uniquely identifies one entity from the other.
Every entity must have a primary key. It is a candidate key chosen as the main method of uniquely
identifying a row.
c. Alternate key - is any candidate key which is not selected to be the primary key
d. Foreign Key: references a particular attribute of an entity containing the corresponding primary key.
These keys are used to create relationships between tables. (For example, an employee entity with
employee number as its primary key and department entity with department number as its primary key
can be related to each other through employee number. Therefore, employee number will be a foreign
key for department and primary key for employee).
e. Compound/Composite Key: A Combination of more than one column identifying records of a table
uniquely.
3 Key Terms
1. Conceptual Entity Relationship Diagram: The highest-level view of the entity relationship diagram,
which contains little detail and is solution agnostic. Showing the overall scope of the ERD model from
the business perspective. This level of modeling establishes the entities, and their relationships, and
defines consistent terminology of the business information.
2. Logical Entity Relationship Diagram: Contains mid-level detail. Attributes are introduced and
operational, transactional, and business rules are defined in this model. This entity relationship diagram
level defines the structure of the data elements and the relationships between them. Logical data models
are associated with the solution design.
3. Physical Entity Relationship Diagram: Provides the most detail. It can be developed for each logical
model. Shows enough detail for subject matter experts to build the physical organization of a database.
Physical entity relationship diagrams describe the database-specific implementation of the model and
illustrate non-functional requirements such as performance, concurrency, and security.
4. Database: A structured collection of information. Usually organized so that data can be easily stored to
allow for prompt research, retrieval, and updating.
5. Adjective: Attributes that describe or provide details about the entity. For example, a student (noun) might
have attributes such as name, age, and address. Note, the term "adjective" is used loosely with the concept
of ERDs as many attributes are formally nouns.
6. Noun (common or proper): Entity type of person, object, concept, or event. For example, a person entity
relevant to school enrollment would be a "student".
7. Verb: Relationship types between entities such as enroll. For example, a student (entity) would "enroll"
in a course (entity).
C. Data Types
Database data types refer to the format of data storage that can hold a distinct type or range of values. When
computer programs store data in variables, each variable must be designated a distinct data type. Some common
data types are as follows:
Integer – is a whole number that can have a positive, negative or zero value. It cannot be a fraction nor can
have decimal places. It is commonly used in programming especially for increasing values. Addition,
subtraction and multiplication of two integers results to an integer. But division of two integers may result
to an integer or a decimal. The resulting decimal can be rounded off or truncated to produce an integer.
Character – refers to any number, letter, space or symbol that can be entered in a computer. Each character
occupies one byte of space.
String – is used to represent text. It is composed of a set of characters that can have spaces and
numbers. Strings are enclosed in quotation marks to identify the data as string and not a variable name nor
a number.
Floating Point Number – is a number that contains decimals. Numbers that contain fractions are also
considered as floating-point numbers.
Array – contains a group of elements which can be of the same data type like an integer or string. It is used
to organize data for easier sorting and searching of related set of values.
Varchar – as the name implies is variable character as the memory storage has variable length. Each
character occupies one byte of space plus 2 bytes for length information. Note: Use Character for data entries
with fixed length, like phone number. Use Varchar for data entries with variable length, like address.
Boolean – is used for creating true or false statements. To compare values the following operators are being
used: AND, OR, XOR, and NOT.
D. Relationship
It is an association between entities, captures how entities are related to one another. Relationships can be
thought of as verbs, linking two or more nouns.
A relationship is how the data is shared between entities.
Are represented by lines between entities, lines indicate that each instance of an entity may have a
relationship with instances of the connected entity, and vice versa.
One-to-many (1: N): is a hierarchical relationship created or viewed from the primary entity. Any one
entity instance from the primary entity can be referenced by many entity instances from the related entity.
One instance of an entity (A) is associated with zero, one or many instances of another entity (B), but for
one instance of entity B there is only one instance of entity (A). Example, for a company with all
employees working in one building, the building name (A) is associated with many different employees
(B), but those employees all share the same singular association with entity
Many-to-many (N: N): A many-to-many relationship lets users relate one or more entity instances from
another entity to an entity instance of the current entity. A many-to-many relationship is reciprocal.
Therefore, entity instances can be related from either entity. One instance of an entity (A) is associated
with one, zero or many instances of another entity (B), and one instance of entity B is associated with one,
zero or many instances of entity A. For example, for a company in which all of its employees work on
multiple projects, each instance of an employee (A) is associated with many instances of a project (B),
and at the same time, each instance of a project (B) has multiple employees (A) associated with it.
4. ER Diagrams Usage
ER is able to describe just about any system, ER diagrams are most often associated with complex databases that
are used in software engineering and IT networks.
In particular, ER diagrams are frequently used during the design stage of a development process in order to
identify different system elements and their relationships with each other. For example: an inventory software
used in a retail shop will have a database that monitors elements such as purchases, item, item type, item source
and item price. Rendering this information through an ER diagram would be something like this:
Figure 1.14 ERD
In the diagram, the information inside the oval shapes is
attributes of a particular entity.
There are three basic elements in an ER Diagram: entity, attribute, relationship. There are more elements which
are based on the main elements. They are weak entity, multi-valued attribute, derived attribute, weak relationship
and recursive relationship.
Entity: An entity can be a person, place, event, or object that is relevant to a given system. For example,
a school system may include students, teachers, major courses, subjects, fees, and other items. Represented
in ERD by a rectangle and named using singular nouns.
Weak Entity: is an entity that depends on the existence of another entity. In more technical terms it can
defined as an entity that can’t be identified by its own attributes. It uses a foreign key combined with its
attributed to form the primary key.
Example: The order item will be meaningless without an order so it depends on the existence of order.
ID Section
Multi-valued Attribute: If an attribute can have more than one value. It is important to note that this is
different to an attribute having its own attributes. For example, a teacher entity can have multiple subject
values.