Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Entity
An entity is a person, place, thing or event for which the data is collected and
maintained. Some example of entity is as follow
Teacher
Person: Teacher, Student, Doctor
Place: Country, City, Province
Object: Vehicle, Toy, Furniture
Event: Purchase, Admission, Registration
Entity Type
A set of entity with same attributes is called entity type. It is also known as
entity class. For example, student entity type has attribute like name, roll no and
age etc.
Entity Instance
A member of an entity class is known as an entity instance. It is also known
as entity occurrence. For example class representative (CR) is an entity instance in
entity type Student.
Entity Set
A set of all entities of a particular entity type in the database at a
given point of time is called an entity set. For example an entity set student
contains all students in the university.
Note: Normally same name is used for both entity type and entity set.
Weak Entity
An entity that exists only if another entity exists is known as weak
entity. It means that a week entity depend upon the existence of another
entity.
Strong Entity
An entity that can exist without the existence of another entity is
known as strong entity. A strong entity is also known as parent, owner or
dominant entity.
Class
For example parent entity and child entity or Class entity and Student
entity. In the above example parent and class are strong entity and child and
students are week entity because they depend upon parent and Class
respectively for their existence. A relationship between strong and weak
entity is identifying relationship.
Associative Entity
Associative entity is a type of entity that associates the instance of one
or many entity types with one another. The attribute of associative represent
the relationship between the entity instances.
Professors
Fig: Associative Entity
Attributes
The characteristics of an entity are called attributes or properties. For
example name, address, class and email of a student are his attributes.
Attribute Domain
An attribute domain is a set of possible values for an attribute. All attribute
have domain. The domain may consist of a range of values or some discrete values.
For example Grade Point Average (GPA) can only be from 0 to 4.
Simple Attributes
An attribute that cannot be subdivided into smaller component is known as
simple attribute or atomic attribute. For example a person can have only one
gender and data of birth.
Name
Student
Composite Attributes
An attribute that can be subdivided into smaller component is known as
composite attribute. For example address can be subdivided into street, city and
country.
City
Street
Country
Address
Employee
Single-Valued Attribute
An attribute that may contain single value is called single-value attribute. For
example, age or gender of a person is single-value attribute.
Multi-Valued Attribute
An attribute that may contain two or more values is called multi-value
attribute. For example, a persons degrees, employees skill or persons profession.
Street
City
Country
Emp_ID
Address
Employee
Stored Attributes
An attribute that is stored in the database is called stored attribute.
Most of the attributes are stored attributes.
Derived Attributes
An attribute which is not stored in database but derived from another
value is called derived attribute. For example you can calculate age of a
person from date of birth.
Identifiers
Identifier is an attribute that identifies an entity instance among other
instance in entity set. For example there may be many instances of student
entity set. But a student is uniquely identified by student ROLLNO.
RollNo
Relationships
A relationship is a logical connection between different entities. The
entities that participate in a relationship are called participants. The
Degree of Relationship
A relationship may consist of many entities. The number of entities in a
relationship is called degree of relationship.
Unary Relationship
Unary relationship is a type of relationship that is established between
the instances of same entity type. This is also known as recursive
relationship.
Player
Plays
with
Student
Study
with
Lives with
Teacher
Binary Relationship
Binary relationship is a type of relationship that exists between two
entity types.
One-to-One Relationship
This type of relationship is exist when for each instance in first entity
type there is only one instance in the second entity type and for each
instance of second entity type there is only one instance in the first entity
type.
Country
Has
President
One-to-Many Relationship
This type of relationship is exist when for each instance in first entity
type there can be many instances in the second entity type and for each
instance of second entity type there is only one instance in the first entity
type.
Country
Has
City
Many-to-Many Relationship
This type of relationship is exist when for each instance in first entity
type there can be many instances in the second entity type and for each
instance of second entity type there can be many instance in the first entity
type.
Student
Studies
Course
Ternary Relationship
Ternary relationship is a type of relationship that exists among the
instances of three entity types.
DBA
works on
Project
Software
Eng.
Cardinality Constraints
The maximum number of relationship is called cardinality. The
cardinality constraint specifies the number of instance of one entity that can
be associated with each instance of the other entity. Three symbols normally
used
Minimum Cardinality
The minimum number of instances of one entity that may be
associated with each instance of another entity is known as minimum
cardinality.
If minimum cardinality is zero we say that it is optional. If the minimum
cardinality is 1 then we say that it is mandatory.
Maximum Cardinality
The maximum number of instances of one entity that may be
associated with each instance of another entity is known as maximum
cardinality. It can be either One or Many.
Optional One
Optional Many
Mandatory One
Mandatory Many
Muslim
NonMuslims
Projects:
A company has a number of employees. Each employee may
be assigned to one or more project or may not be assigned
to a project. A project must have at least one employee
assigned and may have several employees assigned.
Employee
Assigned to
Project
Patient
Has
Record
Account
Charged to
Project
Employee
Managess
Departmen
t
Employs
Departmen
t
manager
manages one department
Person
A
at most. A department
is managed by one manager at most.
Manager
Manages
Departmen
t
Team
Employs
Player
Lecturer
Teacher
Course
Purchase
order
Contains
Product
Post_ID
Name
Assigned to
Students
Address
Date_Birth
Post
Post_Name
Teacher_ID
Teacher
Name
Teaches
Class
Location
Name
Is_Assigned
Employee
DateBirth
Address
Proj_ID
Billing_Rate
Project
Proj_ID
Proj_Name
Course_Name
Course
Is_prerequisite
Units
Emp_ID
Name
Chemist
Phone
Proj_ID
Assign_Date
Assigned
Project
Equipment
Start_Date
Serial_No
Cost
COURSE
Units
Section_NO
Name
Course_ID
Has_Scheduled
Semester_ID
Semester
Year
Admits
Physician_ID
Patient_ID
Physician
Patient
Patient_Name
Treats
Speciality
Treatment_Detail
Date
Results
Time
IsAssigned
Office_No
Sale Office
Location
Employee_ID
Employee
Manages
Employee_Name
Lists
Property_ID
Property
Location
Address
City
State
Parcent_
Owner
Zip_Code
Owns
Owner_ID
Owner
Owner_Name