Dbms Notes Lecture 8 : E R Diagram question with solutions

dinudineshbhawnani 2,458 views 27 slides Jul 24, 2020
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

E R diagram university questions with solutions


Slide Content

UNIT 1
Lecture 8
E R Model

Question 2
•ConstructanE-Rdiagramforacar-insurance
companywhosecustomersownoneormore
carseach.Eachcarhasassociatedwithitzeroto
anynumberofrecordedaccidents.
Dinesh Kumar Bhawnani, BIT DURG

Step 1 : Identify the entity sets
•From the given question the entity sets identified are
1.PERSON
2.CAR
3.ACCIDENT
Dinesh Kumar Bhawnani, BIT DURG

Step 2 : Identify the relevant attributes
•The relevant attributes of PERSON entity set are
•Person_Id
•Person_Name
•Address
•The relevant attributes of CAR entity set are
•Engine_No
•Model
•Year
•The relevant attributes of ACCIDENT entity set are
•Report_No
•Location
•Acc_Date
Dinesh Kumar Bhawnani, BIT DURG

Step 3 : Identify the prime attributes
•The prime attribute of PERSON entity set is
•Person_Id
•The prime attribute of CAR entity set is
•Engine_No
•The prime attribute of ACCIDENT entity set is
•Report_No
Dinesh Kumar Bhawnani, BIT DURG

Step 4 : Identify the relationships
•Customersownoneormorecarseach.
Dinesh Kumar Bhawnani, BIT DURG
PERSON CARowns

Step 4 : Identify the relationships
•Eachcarisassociatedwithitzerotoanynumber
ofrecordedaccidents.
Dinesh Kumar Bhawnani, BIT DURG

Step 4 : Identify the relationships
•Eachcarisassociatedwithitzerotoanynumber
ofrecordedaccidents.
Dinesh Kumar Bhawnani, BIT DURG
PERSON CAR
participated
ACCIDENT

Step 5 : Complete E R Diagram
Dinesh Kumar Bhawnani, BIT DURG
PERSON CAR
participated
ACCIDENT
owns
Person_Id
Person_Name
Address
Model
Year
Engine_No
Report_No Location
Acc_Date
Damage_Amount

Question 3
•DesignanE-Rdiagramforkeepingtrackoftheexploits
ofyourfavoritesportsteam.Youshouldstorethe
matchesplayed,thescoresineachmatch,theplayers
ineachmatchandindividualplayerstatisticsforeach
match.Summarystatisticsshouldbemodeledas
derivedattributes.
Dinesh Kumar Bhawnani, BIT DURG

Step 1 : Identify the entity sets
•From the given question the entity sets identified are
1.MATCH
2.PLAYER
Dinesh Kumar Bhawnani, BIT DURG

Step 2 : Identify the relevant attributes
•The relevant attributes of MATCH entity set are
•Match_Id
•Stadium
•Date
•Opponent
•Own_Score
•Opp_Score
•The relevant attributes of PLAYER entity set are
•Player_Id
•Player_Name
•Summary_Score
Dinesh Kumar Bhawnani, BIT DURG

Step 3 : Identify the prime attributes
•The prime attribute of MATCH entity set is
•Match_Id
•The prime attribute of PLAYER entity set is
•Player_Id
Dinesh Kumar Bhawnani, BIT DURG

Step 4 : Identify the relationships
Dinesh Kumar Bhawnani, BIT DURG
MATCH PLAYERplayed

Step 5 : Complete E R Diagram
Dinesh Kumar Bhawnani, BIT DURG
MATCH PLAYERplayed
Match_Id
Opponent
Stadium
Own_Score Opp_Score
Date
Score
Summary_Score
Player_Id
Player_Name

Question 4
•DesignanE-Rdiagramforkeepingtrackoftheexploitsofyour
favoritesportsteam.Youshouldstorethematchesplayed,thescores
ineachmatch,theplayersineachmatchandindividualplayer
statisticsforeachmatch.Summarystatisticsshouldbemodeledas
derivedattributes.
•ExtendtheE-Rdiagramofthepreviousquestiontotrackthesame
informationforallteamsinaleague.
Dinesh Kumar Bhawnani, BIT DURG

Complete E R Diagram
Dinesh Kumar Bhawnani, BIT DURG
MATCH PLAYERplayed
Match_Id
Opponent
Stadium
Date
Score
Summary_Score
Player_Id
Player_Name
TEAM
team_played player_of
Name Ranking
Result
Team_Score

Question 4
Auniversityregistrar’sofficemaintainsdataaboutthefollowing
entities:(a)courses,includingnumber,title,credits,syllabus,and
prerequisites;(b)courseofferings,includingcoursenumber,year,
semester,sectionnumber,instructor(s),timings,andclassroom;(c)
students,includingstudent-id,name,andprogram;and(d)instructors,
includingidentificationnumber,name,department,andtitle.Further,
theenrollmentofstudentsincoursesandgradesawardedtostudents
ineachcoursetheyareenrolledformustbeappropriatelymodeled.
ConstructanE-Rdiagramfortheregistrar’soffice.Documentall
assumptionsthatyoumakeaboutthemappingconstraints.
Dinesh Kumar Bhawnani, BIT DURG

Step 1 : Identify the entity sets
•From the given question the entity sets identified are
1.COURSE
2.COURSE-OFFERINGS
3.STUDENT
4.INSTRUCTOR
Dinesh Kumar Bhawnani, BIT DURG

Step 2 : Identify the relevant attributes
•TherelevantattributesofCOURSEentitysetare
•Course_No
•C_Tile
•Credits
•Syllabus
•TherelevantattributesofCOURSE-OFFERINGSentitysetare
•Year
•Time
•Secno
•Room
•Semester
•TherelevantattributesofSTUDENTentitysetare
•S_Id
•S_Name
•Program
•TherelevantattributesofINSTRUCTORentitysetare
•I_id
•I_Name
•I_Title
•Dept
Dinesh Kumar Bhawnani, BIT DURG

Step 3 : Identify the prime attributes
•TheprimeattributeofCOURSEentitysetare
•Course_No
•ThereisnoprimeattributeinCOURSE-OFFERINGSentityset,
soitisanweakentityset,howeverthepartialkey
(discriminator)is
•Year
•TheprimeattributeofSTUDENTentitysetis
•S_Id
•TheprimeattributeofINSTRUCTORentitysetis
•I_id
Dinesh Kumar Bhawnani, BIT DURG

Step 4 : Identify the relationship
Dinesh Kumar Bhawnani, BIT DURG
COURSErequires
pre-requisite
main-course

Step 4 : Identify the relationship
Dinesh Kumar Bhawnani, BIT DURG
COURSE
COURSE-
OFFERINGS
Is_offered

Step 4 : Identify the relationship
Dinesh Kumar Bhawnani, BIT DURG
STUDENT enrolls
COURSE-
OFFERINGS

Step 4 : Identify the relationship
Dinesh Kumar Bhawnani, BIT DURG
INSTRUCTORteaches
COURSE-
OFFERINGS

Step 5 : Complete E R Diagram
Dinesh Kumar Bhawnani, BIT DURG
STUDENT INSTRUCTOR
COURSE
enrolls teaches
requires
COURSE-
OFFERINGS
Is_offered
I_id I_Name
Dept I_Title
Course_No
Credits
C_Title
Syllabus
Program
S_Id Grade
S_Name
Time Secno Room
Year
Semester
pre-requisite
main-course

For Video lecture on this topic please subscribe to my youtubechannel.
The link for my youtubechannel is
https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub
_confirmation=1
Dinesh Kumar Bhawnani, BIT DURG