Week 3 Introduction To Database Design
Week 3 Introduction To Database Design
AND MANAGEMENT
TS. NGUYỄN HOÀNG LONG
0916666384
[email protected]
(HOMEWORK)
CHALLENGE 2-1
Entity Entity
Entity
Type Set
ENTITY
• An Entity may be an object with a
physical existence – a particular
person, car, house, or employee – or
it may be an object with a
conceptual existence – a company,
a job, or a university course.
• An Entity is an object of Entity Type
and set of all entities is called as
entity set.
• E.g. student_1 and student_2 are
entities having Entity Type Student
and set of all students is called
Entity Set.
ATTRIBUTE(S)
student_id …
student_name
student
major
An attribute composed of many other attribute is called
as composite attribute. For example, Address attribute of
student Entity type consists of Street, City, State, and
Country.
COMPOSITE In ER diagram, composite attribute is represented by an
ATTRIBUTE oval comprising of ovals.
MULTIVALUED ATTRIBUTE
major class
DATA REDUNDANCY
SOLUTION - 2
STUDENT ENTITY TYPE
student_id Subject_id
student_name
student grade
major
class
SOLUTION - 2
SUBJECT ENTITY TYPE
subject _id …
subject _name
subject
number_of
_credits
SOLUTION - 3
… ENTITY TYPE
??? …
???
???
???
SOLUTION - 3
STUDENT ENTITY TYPE
student_id major
student
class
student_name
SOLUTION - 3
SUBJECT ENTITY TYPE
subject _id …
subject _name
subject
number_of
_credits
LOGICAL DESIGN
RELATIONAL MODEL
• Each entity types need to be converted to Relational models which can directly be
implemented by any RDBMS
• Relational Model was proposed by E.F. Codd to model data in the form of relations or tables.
• Relational Model represents how data is stored in Relational Databases.
student_id
major
PRACTICE 3-2
Enroll subject
student subject
in _name