Session6-INFS1000-S2-2016-preview [Handouts Format](1).pdf

G booking order extend the composite primary key eg

Info icon This preview shows pages 2–6. Sign up to view the full content.

Modelled with an associative entity (e.g., booking, order). Extend the composite primary key (e.g. with time) to allow for multiple transactions between the same subject and object (e.g. hotel guest and room) over time 3. The classifying relationship (one-to-many) Use a TYPE relationship when an attribute isn’t unique to each entity instance, but to a class (type) of entities. In this case you create a new entity (TYPE), and a 1-m relationship with the object entity (e.g. ROOM and ROOM TYPE) You can then assign certain attributes to the TYPE (e.g. Rate as an attribute of ROOM TYPE), and others to the actual object you are classifying (e.g., Floor as an attribute of ROOM).
Image of page 2

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

26/08/2016 3 Unary relationship: relationship between two different instances of an entity. For example, when one employee supervises other employees. In a unary relationship, a link is created between the employee and his/her supervisor. What if an employee can have many supervisors ( M-M relationship )? Unary Relationships Employee Supervises 1 M Employee Supervises 1 M M 1 E_ID Supervisor_ID Supervisor_ID Supervisee_ID E_ID Extend composite primary key: Transactions 1 Books CUSTOMER ROOM M M 1 CID Name Address R_No type CID R_No Date floor BOOKING Example of a Classifying relationship From our analysis (from last week), the hotel operator wants to incorporate an additional idea into the database. Here is what they have to say: “It is important for us to know our room rates. Room rates are set according to the type of room (such as single, double, twin, executive suite, etc).” Extend your ERD based on this information. has ROOMTYPE ROOM 1 M Room_NO RT_ID Name Rate RT_ID Classifying Relationship
Image of page 3
26/08/2016 4 How to model a classifying relationship 1 Books CUSTOMER ROOM M M 1 CID Name Address R_No floor CID R_No Date T_ID BOOKING ROOM TYPE Classifie s M 1 T_ID Name Rate Composite primary key An example of a Hotel Reservation System: What would the tables look like? GuestID RoomID DateIn DateOut 303 12 17‐Aug‐07 18‐Aug‐07 303 11 28‐Sep‐07 11‐Oct‐07 303 7 19‐Oct‐07 25‐Oct‐07 304 4 01‐Jun‐07 03‐Jun‐07 304 Ms Forsythe Dianne 460 Griffin Blvd. Boulder 17‐May‐80 308 Mr Barry Paul 1043 Main Street Denver 14‐Jan‐68 311 Miss Chiang Chung‐Lin 4 Courthouse Lane Fort Collins 19‐Jul‐73 312 Ms Pedicini Susan 26 Concord Drive Kearney 19‐Mar‐78 313 Miss Strzepek Wanda 207 Fox Run Road Grand Junction 13‐Oct‐86 315 Mr Heffernan 388 Central Street Salt Lake City 14‐May‐84 320 Mr Pappas Theodor 29 Rainbow Avenue Boulder 13‐May‐69 Room  Room  $250.00 Curtin $30.00 $60.00 $275.00 Maquarie $30.00 $60.00 14 C $350.00 Wattle $45.00 $120.00 $230.00 Cowan $20.00 $50.00 $240.00 Simpson $25.00 $55.00 Foreign Key CUSTOMER / GUEST Table ROOM Table BOOKING Table Primary key Primary key Hotel Reservation System: An example of a form to work with the database Forms Used to read, insert, modify, and delete data via a user-friendly interface
Image of page 4

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

26/08/2016 5 Hotel Reservation System: An example of a query Queries Are a means of getting answers from database data Queries feed into reports e.g., How many nights did each guest stay in January 2008?
Image of page 5
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.
  • Three '10
  • N/A
  • Ethics , Modeling (ERDs)

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern