You are on page 1of 35

Definitions

v Database: An Organized collection of logically related


data, usually designed to meet the information needs of
multiple users in an organization
v Data: stored representations of meaningful objects and
events
– Structured: numbers, text, dates
– Unstructured: images, video, documents
v Information: data processed to increase knowledge in the
person using the data
v Metadata: data that describes the properties and context of
user data

1
Figure 1-1a Data in context

Context helps users understand data


2
Figure 1-1b Summarized data

Graphical displays turn data into useful


information that managers can use for
decision making and interpretation
3
Descriptions of the properties or characteristics of the
data, including data types, field sizes, allowable
values, and data context
4
Types of data

vStructured data
includes numbers, text, dates.
Numeric data (numbers), this type of data consists numeric
digits from 0-9. It may either be positive or negative.

Alphabetic data (text), this type of data consists of


alphabetic letters from A-Z,(a-z), blank space e.g “Ali shah’,
“hayat” etc.

Alphanumeric data (dates), it consists digits (0-9), letters


(a-z, A-Z) and all special characters (*,+,@,&,#….)
5
Types of data
v Unstructured data
Includes images, audio, videos
Images data consists charts, pictures, paintings.

Audio data , that type of data includes music(audio), speech


or any type of sound.
Video data, collection of full motion images played at high
speed. And used to display actions and movements.

6
Data Vs Information
v Data unprocessed raw v Information is processed
facts form of data
v Data is meaningless v Information is meaningful
v Data is the input of v Information is the output
computer of computer
v Data is extensive in its v Information is short in
volume volume
v Data is used rarely v Information is frequently
used
v Data is independent v Information is dependent
v Data is not functional in on data
decision making v Information is functional
in decision making

7
Entity & Its types
Entity
“An entity is a person, place, object, event or concept in the
user envirment about which the organization wishes to
maintain data”

Example-1; a library system may contain data about different


entities like BOOK and MEMBER
Example-2; a college system may include entities like
STUDENT, TEACHER, CLASS etc.

8
Entity & Its types
Some Examples of Entities
vPerson : employee, Student, Player, Doctor, Patient
vPlace : Country, City, Store

vObject : Vehicle, Toy, Furniture, Building

vEvent : Sale, Admission, Registration

vConcept : Programming, Account, Course

The following symbol used for an entity in ERD.

9
Entity & Its types

vEach entity in ERD is given a name, since name represent


a collection of items (called attributes)
vThe entity name is always a singular

vWe represent the name of entity is capital letters

vIn ERD the entity name is placed inside a box


(entity symbol) representing the entity type. i.e

STUDENT
STUDENT entity may have the attributes
S_Name, F_name, Address, Class, DOB etc
10
Entity & Its types

Entity Type: “A collection of entities that share common


properties or charactistics”
OR
“A set of entities with same attributes is called entity type”

vWe use capital letters for the names of entity type(s)


vAn entity type is described just once (using metadata) in a
database.

For example

11
Entity & Its types
Entity type:
STUDENT

STUDENT_ID INT(4)
S_NAME CHAR(30)
F_NAME CHAR(30)
ADDRESS CHAR(40)
DEPARTMENT_NAME CHAR(30)
CLASS CHAR(25)
BIRTHDATE DATE

12
Entity & Its types
Entity Instance: “A single occurrence of an entity
type”
OR
“A member of an entity type is known as an entity
instance”

Example:
Two instances of STUDENT (Entity Type)
See example on next page

13
Entity & Its types

v Instance 1st Instance 2nd


01 02
Ali Jan
M Shah Zain
Peshawar Islamabad
IBMS IBMS
Bs(IT) Bs(IT)
July 13,1990 Sep 03, 1991

14
Entity & Its types

Many instances ( hundred or thousands) of that


entity type (STUDENT) may be represented by
data stored in the database.

15
Entity & Its types
STRONG ENTITY VS WEAK ENTITY TYPES
Strong Entity Type:
“An entity type that exist independently of other entity types”

v Most of the basic entity types to identify in an organization


are classified as strong entity types.

v Instances of a strong entity type always have a unique


charactistics (called identifier) that is an attribute or
combination of attributes that uniquely distinguish each
occurrence of that entity.

16
Entity & Its types

v To represent strong entity in ER Diagram, the


following symbol is used

v Weak Entity Type: “an entity type whose


existence depends on some other entity type”

17
Entity & Its types
v A weak entity type has no business meaning in the
ER Diagram without the entity on which it
depends.

v The below symbol is used for weak entity type.

v Identifying Owner:” the entity type on which the


weak entity type depends”

18
Entity & Its types
v A weak entity type does not have its own
identifier, Generally on an ERD a weak entity type
has an attribute that serves as a partial identifier.

v Identifying Relationship: “ the relationship b/w a


weak entity type and its owner(identifying
owner)”
v Example (next page)

19
Entity & Its types

EMPLOYEE DEPENDENT
Dependent_name
E_ID
(first_name,
E_Name middle_name,
last_name)
DOB

Example of weak entity type and its identifying


relationship 20
Entity & Its types
v In above Fig EMPLOYEE is a strong entity type,
with identifier Employee_ID.

v DEPENDENT is a weak entity type as indicated


by double line rectangle.

v EMPLOYEE (Strong entity type) is the owner of


DEPENDENT (weak entity type)

v “Has” shows the identifying relationship(double


lined diamond symbol).
21
Entity & Its types
v The attribute ‘Dependent_Name’ serves as a
partial identifier.

v We use double underline to show a partial


identifier.

Identifier: “An attribute or combination of attribute


that uniquely distinguish individual instance of an
entity type”

22
Entity & Its types
v The above Fig ,can be represented in more simple form as

Strong entity Identifying relationship Weak entity

23
Attributes & its types
v Attribute – “property or characteristic of an
entity type that is of interest to the
organization”
v Each entity type has a set of attributes
associated with it.
v In Entity Relationship Diagram(ERD) we
represent an attribute with sign of ellipse.
Attribute Symbol in
ERD
24
Attributes & its types
v Following are the some entity types and
their associated attributes

I. STUDENT
[ Student_ID, Student_Name, Home_Address,
Phone_Number]
II. EMPLOYEE
[Employee_ID, Employee_Name,
Designation, Department].
25
Attributes & its types
v Innaming attributes, we use an initial
capital letter and other are in lower
case.

v We represent an attribute(in ERD) by


placing its name in an
ELLIPS(symbol) with a line
connecting it to its associated entity.
e.g (next page)
26
Attributes & its types

Student_ID Student_Name Home_Address

STUDENT

Phone_Number

27
Attributes & its types
v Types of Attributes:
-Simple Attribute
-Composite Attribute
-Single valued Attribute
-Multi-Valued Attribute
-Derived Attribute
-Stored Attribute

28
Attributes & its types
-Simple Attribute: “An attribute that can not
be subdivided into smaller component is
known as simple attribute”

Fig shows
STUDENT entity
and their
attributes(simple
attributes)
29
Attributes & its types

- -Composite Attribute: “An attribute that can


be divided into smaller components”
Example-1
An attribute broken
into component parts

30
Attributes & its types
Example-2

CUSTOMER entity type with


composite
attribute(Customer_Address)

31
Attributes & its types
Single-valued Vs Multi-valued Attribute:
Single-valued attribute: “An attribute that may
contain single value”
e.g. Age of a person is a single-value attribute, also
gender is the example of single-value attribute.

Multi-valued attribute: “An attribute that may


contain two or more values”
v Multi-valued attribute is represented by double-
line oval.

32
Attributes & its types

Employee entity type


with multi-valued
attribute(Skill)
Multivalued:
an employee can have
more than one skill

33
Attributes & its types
Derived Attribute: “an attribute whose value can be calculated
from other related attribute”
The following fig show s the derived attribute

Multivalued:
Derived an employee can have
from date employed and current date more than one skill
34
Attributes & its types
Stored Attribute: “An attribute that is stored in a
database is called stored attribute”

Attribute Domain: “A set of possible values for an


attribute is known as attribute domain”
The domain may consist of range of a values or
some discrete values.
e.g. the domain for GPA can be from 0-4, similarly
the domain for ‘Gender’ attribute can be either
‘Male’ or ‘Female’.

35

You might also like