Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
13 views18 pages

Db-Lecture 7

Database system

Uploaded by

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

Db-Lecture 7

Database system

Uploaded by

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

Database Systems

Lecture -7
By Saima yousaf
Overview of Lecture

Constructs in E-R Data


Model
• Entity
• Different types of Entities
• Attribute and its different
types
The Entity
Entity is basic building block of the E-R data model. The term entity
is used in three different meanings or for three different terms and
that are:
• Tangible Entity : Entities that exist in the real world physically.
Example: Person, car, etc.
• Intangible Entity : Entities that exist only logically and have no
physical existence. Example: Bank Account, etc.
Classification of entity
types

• Strong Entity
A strong entity in DBMS is an independent table that
doesn't rely on any other tables for its existence.
• Weak Entity
weak entity type is a dependent table that relies on
another table for its existence
Common term in database

•Entity type
•Entity set
•Entity instance
Entity Type

It is collection of entity having common attribute. As in


Student table each row is an entity and have common
attributes. So STUDENT is an entity type which contains
entities having attributes id, name and Age. Also each
entity type in a database is described by a name and a list
of attribute. So we may say a table is an entity type
• Example :
• A table named student in a university database.
• A table named employee in a company database
Entity Set
An entity set is a collection or set of all entities of
a particular entity type at any point in time. The
type of all the entities should be the same.
Example
• The collection of all the students from the
student table at a particular instant of time is an
example of an entity set.
• The collection of all the employees from the
employee table at a particular instant of time is
an example of an entity set.
Entity Instance

A member of an entity class is also known as an


entity instance. It is also known as entity
occurrence. Each entity instance of an entity
type has its own value for each instance. For
example, a student ali of student entity is an
entity instance.
Attributes

Attributes in a database refer to the


characteristics or properties of the entities
being stored. They define the type of data
that can be stored in a particular field within
a database table. Attributes are also known
as columns or fields.
Types of Attributes

• Attributes may be of different types. They may be:


• Simple
• Composite
• Single valued
• multi-valued
• Stored
• Derived
Simple Attribute

Simple : An attribute that is a single whole is a


simple attribute. The value of a simple attribute is
considered as a whole, not as comprising of other
attributes or components. For example, attributes
stName, stFatherName, stDateOfBorth of an entity
type STUDENT are example of simple attributes.
Composite attributes

• An attribute consists of collection of


other simple or composite attributes
then it is called a composite
attributes. For example, stAdres
attribute may comprise of houseNo,
streetNo, areaCode, city etc. In this
case stAdres will be a composite
attribute.
Single valued

• Some attribute have single value at a


time. For example name, father
name, designation are generally
single valued attributes.
Multi valued Attributes

Some others may have multiple values is


called multi valued attributes. For example,
hobby attribute of STUDENT or skills
attribute of EMPLOYEE, since a student may
have multiple hobbies, likewise an employee
may have multiple skills so they are multi-
valued attributes.
Stored Attributes

Normally attributes are stored attributes,


that is, their values are stored and accessed
as such from the database. For example, we
may store the, date of birth of employees.
Derived attributes

Sometimes attributes’ values are not stored as


such, rather they are computed or derived based
on some other value. This other value may be
stored in the database or obtained some other
way. For example age can be computed from date
of birth.

You might also like