Co202 Dbms Lab Assignment - 04: Strong Entity
Co202 Dbms Lab Assignment - 04: Strong Entity
Co202 Dbms Lab Assignment - 04: Strong Entity
Assignment - 04
AIM: To represent all the entities (Strong & Weak), keys (Primary & Foreign) and
relationships in a tabular fashion for a Bus Reservation System.
THEORY:
Strong entity
● Simply strong entity is nothing but an entity set having a primary key attribute
or a table which consists of a primary key column
● The primary key of the strong entity is represented by underlining it
Representation
○ The strong entity is represented by a single rectangle.
○ Relationship between two strong entities is represented by a single
diamond.
Weak entity
● A weak entity is an entity set that does not have sufficient attributes for Unique
Identification of its records
● Simply a weak entity is nothing but an entity which does not have a primary key
attribute
Representation
○ A double rectangle is used for representing a weak entity set
○ The double diamond symbol is used for representing the relationship
between a strong entity and weak entity which is known as identifying
relationship.
Keys
Types of keys:
1. Primary key
● It is the first key used to identify one and only one instance of an entity uniquely.
An entity can contain multiple keys, as we saw in the PERSON table. The key
which is most suitable from those lists becomes a primary key.
● In the EMPLOYEE table, ID can be the primary key since it is unique for each
employee.
2. Candidate key
● A candidate key is an attribute or set of attributes that can uniquely identify a
tuple.
● Except for the primary key, the remaining attributes are considered a candidate
key. The candidate keys are as strong as the primary key.
For example: In the EMPLOYEE table, id is best suited for the primary key. The rest of
the attributes, like SSN, Passport_Number, License_Number, etc., are considered a
candidate key.
3. Super Key
Super key is an attribute set that can uniquely identify a tuple. A super key is a
superset of a candidate key.
4. Foreign key
● Foreign keys are the column of the table used to point to the primary key of
another table.
● In the EMPLOYEE table, Department_Id is the foreign key, and both the tables
are related.
5. Alternate key
Out of all candidate keys, one key is chosen as the primary key, and the remaining
candidate key, if it exists, is termed the alternate key. In other words, the total number
of the alternate keys is the total number of candidate keys minus the primary key. The
alternate key may or may not exist.
6. Composite key
7. Artificial key
The key created using arbitrarily assigned data are known as artificial keys. These keys
are created when a primary key is large and complex and has no relationship with
many other relations.
RESULT:
We have successfully implemented the ER Model for Bus Reservation System.