+ All Categories
Home > Documents > Exercise in ERD

Exercise in ERD

Date post: 20-Feb-2018
Category:
Upload: lei-casiple
View: 239 times
Download: 0 times
Share this document with a friend

of 22

Transcript
  • 7/24/2019 Exercise in ERD

    1/22

    COP 4710: Database Systems (ERD Practice) Page 1 Mark Lleelly!

    COP 4710: Database Systems

    Fall 2010

    ERD Practice Problems

    Department of Electrical Engineering an Comp!ter Science

    "ni#ersity of Central Floria

    $nstr!ctor : Dr% &ar' (le)ellyn

    mar'l*cs%!cf%e!

    +EC 2,-. 407/2,/270

    ttp:33)))%cs%!cf%e!3co!rses3cop47103fall2010

  • 7/24/2019 Exercise in ERD

    2/22

    COP 4710: Database Systems (ERD Practice) Page " Mark Lleelly!

    The entity type STUDENT has the followingattributes: Student_Name, Address, hone,

    Age, A!ti"ity, and No_of_years# A!ti"ity

    represents some !ampus$based student

    a!ti"ity, and No_of_years represents the

    number of years the student has engaged in

    this a!ti"ity#

    A gi"en student may engage in more than one

    a!ti"ity#

    Scenario 1

  • 7/24/2019 Exercise in ERD

    3/22

    COP 4710: Database Systems (ERD Practice) Page # Mark Lleelly!

    ERD For Scenario 1

    Oler Style ER 5otation

  • 7/24/2019 Exercise in ERD

    4/22

    COP 4710: Database Systems (ERD Practice) Page 4 Mark Lleelly!

    5e) Style ERD For Scenario 1

    Deri#e attrib!te

    Simple attrib!tes

    6ey attrib!te

    &!lti/#al!e attrib!te

    Composite attrib!te

  • 7/24/2019 Exercise in ERD

    5/22

    COP 4710: Database Systems (ERD Practice) Page $ Mark Lleelly!

    A !ompany has a number of employees# The attributes of

    E%&'(EE in!lude Emp_)D *identifier+, Name, Address, andirthdate#

    The !ompany also has se"eral pro-e!ts# Attributes of .'/E0Tin!lude ro-_)D *identifier+, ro-_Name, and Start_Date#

    Ea!h employee may be assigned to one or more pro-e!ts, or maynot be assigned to any pro-e!t#

    A pro-e!t must ha"e at least one employee assigned to it, andmay ha"e any number of employees assigner to it#

    An employee1s billing rate may "ary by pro-e!t, and the!ompany wishes to re!ord the appli!able billing rate*illing_.ate+ for ea!h employee when assigned to a parti!ular

    pro-e!t#

    Scenario 2

  • 7/24/2019 Exercise in ERD

    6/22

    COP 4710: Database Systems (ERD Practice) Page % Mark Lleelly!

    ERD For Scenario 2

  • 7/24/2019 Exercise in ERD

    7/22

    COP 4710: Database Systems (ERD Practice) Page 7 Mark Lleelly!

    5e) Style ERD For Scenario 2

    ttrib!te of te

    relationsip

    Optionalparticipation%

    5ot e#ery

    employee )or's on

    a pro8ect%

    &anatory

    participation%

    E#ery pro8ect m!st

    a#e an employee %

  • 7/24/2019 Exercise in ERD

    8/22

    COP 4710: Database Systems (ERD Practice) Page & Mark Lleelly!

    A uni"ersity has a large number of !ourses in its

    !atalog#

    Attributes of 0'U.SE in!lude 0ourse_num*identifier+, 0ourse_Name, and 0redit_2rs#

    Ea!h !ourse may ha"e one or more different !oursesas prere3uisites, or may ha"e no prere3uisites#

    Similarly, a parti!ular !ourse may be a prere3uisite for

    any number of !ourses, or may not be a prere3uisitefor any other !ourse#

    Scenario ,

  • 7/24/2019 Exercise in ERD

    9/22

    COP 4710: Database Systems (ERD Practice) Page ' Mark Lleelly!

    ERD For Scenario ,

    Credit_hrs

  • 7/24/2019 Exercise in ERD

    10/22

    COP 4710: Database Systems (ERD Practice) Page 10 Mark Lleelly!

    5e) Style ERD For Scenario ,

  • 7/24/2019 Exercise in ERD

    11/22

    COP 4710: Database Systems (ERD Practice) Page 11 Mark Lleelly!

    A uni"ersity !ourse may ha"e one or more s!heduled

    se!tions, or it may not ha"e a s!heduled se!tion#

    Attributes of 0'U.SE in!lude 0ourse_)D*identifier+, 0ourse_Name, and 0redit_2rs#

    Attributes of SE0T)'N in!lude Se!tion_Number andSemester_)D# Semester_)D is !omposed of two parts:Semester and (ear# Se!tion_Number is an integer thatdistinguishes one se!tion from another for the same

    !ourse but it does not uni3uely identify a se!tion#

    Scenario 4

  • 7/24/2019 Exercise in ERD

    12/22

    COP 4710: Database Systems (ERD Practice) Page 1" Mark Lleelly!

    ERD For Scenario 4

    Section )as moele as a )ea' entity% $t co!l

    a#e been moele as a m!lti/#al!e attrib!te of

    co!rse. o)e#er. tis moel allo)s a section of a

    co!rse to a#e a relationsip )it anoter entity

    9tin' instr!ctor or st!ent;te m!lti/#al!e

    attrib!te case )o!l not allo) tis relationsip%

  • 7/24/2019 Exercise in ERD

    13/22

    COP 4710: Database Systems (ERD Practice) Page 1# Mark Lleelly!

    5e) Style ERD For Scenario 4

    Section )as moele as a )ea' entity% $t co!l

    a#e been moele as a m!lti/#al!e attrib!te of

    co!rse. o)e#er. tis moel allo)s a section of a

    co!rse to a#e a relationsip )it anoter entity

    9tin' instr!ctor or st!ent;te m!lti/#al!e

    attrib!te case )o!l not allo) tis relationsip%

  • 7/24/2019 Exercise in ERD

    14/22

    COP 4710: Database Systems (ERD Practice) Page 14 Mark Lleelly!

    A laboratory has se"eral !hemists who wor4 on one or more pro-e!ts#

    0hemists may also use !ertain 4inds of e3uipment on ea!h pro-e!t#Attributes of 02E%)ST in!lude Employee_)D *identifier+, Name, andhone_no#

    Attributes of .'/E0T in!lude ro-e!t_)D *identifier+ and Start_Date#

    Attributes of E5U)%ENT in!lude Serial_no# and 0ost#

    The organi6ation wants to re!ord Assign_Date 7 that is, the date whena gi"en e3uipment item was assigned to a parti!ular !hemist wor4ingon a spe!ified pro-e!t#

    A !hemist must be assigned to at least one pro-e!t and one e3uipmentitem#

    A gi"en pie!e of e3uipment need not be assigned, and a gi"en pro-e!tneed not be assigned either a !hemist nor a pie!e of e3uipment#

    Scenario an

    PRO?EC> o not nee to

    participate in anyassignments% ll entities

    can a#e m!ltiple

    assignments%

  • 7/24/2019 Exercise in ERD

    17/22

    COP 4710: Database Systems (ERD Practice) Page 17 Mark Lleelly!

    ro-e!ts )n!#, is an engineering firm with appro8imately 9 employees# A database is re3uired to4eep tra!4 of all employees, their s4ills, assigned pro-e!ts, and departments in whi!h they wor4# E"ery employee has a uni3ue number assigned by the firm, a name, and date of birth# )f anemployee is married to another employee of the firm, the data of the marriage and who is married

    to whom must be stored; howe"er, no re!ord of marriage is re3uired if an employee1s spouse is notalso an employee# Ea!h employee has a -ob title# Ea!h employee does only one type of -ob at atime, and we only need to retain information about an employee1s !urrent -ob#

    There are or ea!h !ity, we are interested in its state and

    population#

    An employee !an ha"e many s4ills, but they !an use only a gi"en set of s4ills on a parti!ular

    pro-e!t# Employees use ea!h s4ill that they posses in at least one pro-e!t# Ea!h s4ill is assigned anumber, and we will re!ord a short des!ription of ea!h s4ill#

    ro-e!ts are distinguished by pro-e!t numbers and we must store the estimated !ost of ea!h pro-e!t#

    Scenario -

  • 7/24/2019 Exercise in ERD

    18/22

    COP 4710: Database Systems (ERD Practice) Page 1& Mark Lleelly!

    ERD For Scenario -

  • 7/24/2019 Exercise in ERD

    19/22

    COP 4710: Database Systems (ERD Practice) Page 1' Mark Lleelly!

    5e) Style ERD For

    Scenario -

  • 7/24/2019 Exercise in ERD

    20/22

    COP 4710: Database Systems (ERD Practice) Page "0 Mark Lleelly!

    Ea!h semester, ea!h student must be assigned an ad"isor who

    !ounsels students about degree re3uirements and helps thestudents register for !lasses#

    Ea!h student must register for !lasses with the help of anad"isor, but if the student1s assigned ad"isor is not a"ailable, the

    student may register with any ad"isor# =e must 4eep tra!4 of students, the assigned ad"isor for ea!h,

    and the name of the ad"isor with whom the student registerd forthe !urrent term#

    Scenario 7

  • 7/24/2019 Exercise in ERD

    21/22

    COP 4710: Database Systems (ERD Practice) Page "1 Mark Lleelly!

    ERD For Scenario 7

  • 7/24/2019 Exercise in ERD

    22/22

    COP 4710: Database Systems (ERD Practice) Page "" Mark Lleelly!

    5e) Style ERD For Scenario 7


Recommended