Unit – II: ER Model and Relational Algebra (Marks-16)
Basic concepts of E-R
What is E-R diagram?
E-R diagram: (Entity-Relationship diagram)
It is graphical (pictorial) representation of database.
It uses different types of symbols to represent different objects of database.
Define Entity & Attribute. 02 - Winter-2021, 2020
Entity - An entity is a person, a place or an object.
An entity can be a real-world object OR it knows as facts that can be recorded and have implicit meanings
(data).
An entity is represented by a rectangle which contains the name of an entity. Entity Name
Entities of a college database are: Student, Professor/Faculty, Course, Department, Result, Class, Subject
o Types of Entities:
i. Concrete Entity- Physically existing entity (Ex. Customer, Employee)
ii. Abstract Entity- No physically existence (Ex. Account, Subject)
Entity Set - An entity set is a set (group) of entities of same type. An entity set may contain entities with
attribute sharing similar values.
Example, All persons having an account in a bank, All the students studying in a college, All the
professors working in a college, Set of all accounts in a bank
Explain all types of Attributes. 04 - Winter-2021
Explain the different attributes in database. 03 – Summer-2019, 2016, Winter-2018, 2019, 2015
Differentiate between STORED ATTRIBUTE and DERIVED ATTRIBUTE. 03 – Summer-2017
Differentiate between SIMPLE ATTRIBUTE and COMPOSITE ATTRIBUTE. 03 – Summer-17
Attributes (single, composite, multivalued, Derive)
Attribute (Column) is a property of an entity.
Attribute
An attribute is represented by an oval containing name of an attribute. Name
Attributes of Student are: Roll No, Student Name, Branch, Semester, Address, Mobile No, Age, SPI,
Backlogs
Department of Information Technology [Ms. Nikita A. Patel] 1
, Database Management (Unit-2) | 4331603
Types of Attributes
1. Simple attribute v/s Composite Attribute
2. Single-valued Attribute v/s Multi-valued Attribute
3. Stored Attribute v/s Derived Attribute
1. Simple attribute - Simple attributes cannot be divided into smaller sub-parts.
o Example, a student's enrollment no. EnrollNo
2. Composite attribute - Composite attributes can be divided into smaller sub-parts of attributes.
o Example, a student's complete name may have firstname, middlename and lastname
StudentName
FirstName LastName
MiddleNam
e
o Example, Address attribute can be divided into subparts such as Society, city and pincode.
Address
Society
City Pincode
3. Single-value attribute - Single-value attributes contain single value.
o Example, Enrollment No
4. Multi-value attribute - Multi-value attributes may contain more than one value.
o Example, a Person can have more than one Phone number, EmailId, etc. PhoneNo
5. Stored attribute - Stored attributes are the attributes that store data in the physical database
o Example, Birthdate.
6. Derived attribute - Derived attributes are the attributes that do not exist in the physical database, but their
values are derived from other attributes present in the database.
o Example, Age can be derived from birthdate.
Age
ER diagram for following schema: Student (Roll_no, Name, Birthdate, Age, PhoneNo.)
Where Roll_No is a primary key, PhoneNo.is a multi-valued attribute and Age is a derived attribute
Department of Information Technology [Ms. Nikita A. Patel] 2