0% found this document useful (0 votes)
8 views

DBMS2

Uploaded by

mname3212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

DBMS2

Uploaded by

mname3212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

LAB-2

Aim:-Define entity and relationship in databases with example.


Description:-
Entity:- An entity is a “thing” or “object” in the real world that is
distinguishable from all other objects.
 For example, each person in a university is an entity.
 An entity has a set of properties, and the values for some set of
properties must uniquely identify an entity.
 For instance, a person may have a person id property whose value
uniquely identifies that person.
 An entity may be concrete, such 6.2 The Entity-Relationship Model 245
as a person or a book, or it may be abstract, such as a course, a course
offering, or a flight reservation.
 An entity set is a set of entities of the same type that share the same
properties, or attributes. The set of all people who are instructors at a
given university, for example, can be defined as the entity set instructor.
 We use the term extension of the entity set to refer to the actual
collection of entities belonging to the entity set.Entity sets need not be
disjoint.
 An entity is represented by a set of attributes.
 Each entity has a value for each of its attributes.
 An entity set is represented in an E-R diagram by a rectangle, which is
divided into two parts. The first part, which in this text is shaded blue,
contains the name of the entity set. The second part contains the names
of all the attributes of the entity set.

Instructor

ID
Name
Salary
 The unique attribute (key attribute) is underlined.

Relationship:-
 A relationship is an association among several entities.
 For example, we can define a relationship advisor that associates
instructor Katz with student Shankar. This relationship specifies that Katz
is an advisor to student Shankar.
 A relationship set is a set of relationships of the same type.
 We define the relationship set advisor to denote the associations
between students and the instructors who act as their advisors.
 A relationship instance in an E-R schema represents an association
between the named entities in the real-world enterprise that is being
modeled.

Instructor Student

ID ID
Advisor
Name Name

Salary Tot_cred

E-R Diagram showing relationship set advisor


 A relationship set is represented in an E-R diagram by a diamond, which
is linked via lines to a number of different entity sets (rectangles).
 A relationship set is a mathematical relation on n>=2 entity sets.
 A relationship may also have attributes called descriptive attributes.They
are represented in an E-R diagram by an undivided rectangle. We link
the rectangle with a dashed line.
 The number of entity sets that participate in a relationship set is the
degree of the relationship set.
 A binary relationship set is of degree 2.
 A ternary relationship set is of degree 3.
Grade

|
|

Student Section
Takes

Result:-
2) Aim:-Listing the tools to draw ER diagrams in both offline and online.

Description:-
Offline tools:-
 Microsoft visio:-A popular diagramming tool that provides
various templates and shapes for ER diagrams.
 Lucidchart(Desktop Version):-Although primarily online,it also
offers offline capabilities.
 Dia:-An open-source diagramming tool with support for ER
diagrams.
 Draw.io.Desktop:-The offline version of the popular online tool
for creating diagrams.
 Adobe illustration:-While not specialized for ER diagrams,it’s
versatile for creating any visual representation.
 OmniGraffle:-A powerful diagramming and graphic design tool
available for macOs.
 Pencil Project:-An open-source tool that can be used to create
ER diagrams.
Online tools:-
Lucidchart:-A web-based application with extensive features for
creating ER diagrams.
Draw.io:-An online diagramming tool that supports a wide range of
diagram types,including ER diagram.
Creately:-An online diagram tool that provides templates for ER
diagrams.
Gliffy:-Another online diagramming tool with support for ER
diagrams.
Microsoft visio Online:-The web-based version of Microsoft visio.
SmartDraw:-An online diagramming tool with ER diagram templates.
Miro:-An online collaborative whiteboard platform with
diagramming capabilities.
DBDesigner:-An online tool specifically for designing and managing
ER diagrams and databases.
ERDplus:-A dedicated online tool for creating ER diagrams,relational
schemas and more.

Result:-
3) Aim:-Analyzing the given examples.

Description:-
Faculty Information Chen ERD :-

Analysis:-
 Entities:-Common user,faculty information,administrator and
teacher user
 Attributes of common user:-id,user name,password
 Attributes of faculty information:
id,name,department,school,telephone no.
 Attributes of Administrator:-id,username,password
 Attributes of teacher user:-id,username,password
 Inquiry,Service,Modify all relationships are binary.
 Inquiry is the relationship betwwen commom user and faculty
information entities.
 Service is the relationship between faculty information and
administrator entities.
 Modify is the relationship between faculty information and
teacher user entities.
 Inquiry is a many to one relationship.
 Modify is a one to many relationship.
 Service is a one to one relationship.
Storage System ER Diagram:-

Analysis:-
 Entities:-Warehouse,entity name,product,consignee
 Attributes of Warehouse:-warehouse code,warehouse
name,contact person,contace information,position
 Attributes of Entity name:-
Attribute,Attribute,Attribute,Attribute,Attribute
 Attributes of Product:-product no.,arrive batch,product
name,product type,Tag UID,Package UID,Product
quality,production date,in storage date,deadline,warehouse
code,location no.
 Attributes of Consignee:-consignee code,consignee
name,address,contact person,contact info
 Attributes of Inventory:-Amount
 Work,Inventory,Out of storage all relationships are binary.
 Work is the relationship between warehouse and entity
entities.
 Inventory is the relationship between Warehouse and product
entities.
 Out of storage is the relationship between product and
consignee entities.

You might also like