Database
Database
LEVEL-II
Module Title: - Operate Database Application
Module code: EIS HNS2 M03 0322
Nominal duration: 60Hour
Customer Employee
c-id e- id
c-name e- name
c-age e- age
c-sex e- sex
c-phone e- address
c-address e- salary
c-id
TYPES OF DATABASE
RELATIONSHIPS
One-to-one relationships: occur when each entry
in the first table has one, and only one,
counterpart in the second table.
One-to-many relationships: Is the most common
type of database relationship.
Many-to-many relationships: occur when each
record in the first table corresponds to one or
more records in the second table and each record
in the second table corresponds to one or more
records in the first table.
ER DIAGRAM (ENTITY
RELATIONSHIP DIAGRAM)
An Entity Relationship Diagram (ERD) is a visual representation of different data using
conventions that describe how these data are related to each other. For example, the elements
writer, novel, and consumer may be described using ER diagrams this way:
Weak Entity
A weak entity is an entity that depends on the existence of another entity.
In more technical terms it can defined as an entity that cannot be identified
by its own attributes.
It uses a foreign key combined with its attributed to form the primary key.
An entity like order item is a good example for this. The order item will
be meaningless without an order so it depends on the existence of order.
Multi valued Attribute
If an attribute can have more than one value it is called a multivalued attribute.
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.