Unit-2 DBMS
Unit-2 DBMS
• Example :
• A table named student in a university database.
• A table named employee in a company database.
• Note :
• The category of a particular entity in the relation in RDBMS is called the entity type.
• It is represented by the name of the table and its schema.
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.
Example
• Consider a table student as follows :Table Name : Student
Entity : Each row is an entity.
Example :
Entity Type : Each entity belongs to the student type. Hence, the type of
entity here is a student.
Entity Set : The complete data set of all entities is called entity set.
For the above table, the records with student id 1, 2, 3, 4 are the entity set.
Difference Table
Classification of Entities
• Strong Entity:
A strong entity is not dependent on any other entity in the schema.
• A strong entity will always have a primary key.
• Strong entities are represented by a single rectangle.
• The relationship of two strong entities is represented by a single diamond.
• Various strong entities, when combined together, create a strong entity set.
• Weak Entity:
A weak entity is dependent on a strong entity to ensure its existence.
• Unlike a strong entity, a weak entity does not have any primary key.
• It instead has a partial discriminator key. A weak entity is represented by a double
rectangle.
• The relation between one strong and one weak entity is represented by a double
diamond.
• This relationship is also known as identifying relationship.
Weak Entity: Example
Difference between Strong and Weak
Entity:
Attribute
• Some attributes can possess over one value, those attributes are
called multivalued attributes.
• The double oval shape is used to represent a multivalued attribute.
Derived Attribute