Data+Modeling+II

**Data Modeling II** Tuesday, October 25, 2011 <>

In class today we will build on the previous class's introduction to Data Modeling by introducing more sophisticated types of relationships and doing some in-class exercises to practice working with ER Models.
 * Topic overview: **

By the end of today's class you should be able to:
 * Apply the concept of //degree//of relationships (unary, binary, ternary) and apply it to your ER models
 * Apply the concept of //cardinality//in relationships (one-to-one, one-to-many, many-to-many) and apply it to your ER models
 * Use //associative entities// in your ER models appropriately.

**Preparation for class:** In today's class we will cover the second half of chapter 3 of the book:


 * Jeffrey Hoffer, Mary Prescott, Heikki Topi, Modern Database Management, 9th edition, Pearson Prentice-Hall, 2009, ISBN: 0-13-600391-5.

This reading is available on digital reserve through Blackboard.

Specifically, for today's class, you need to read the section on relationships, covering pages 110 - 128. You are not responsible for the chapter after page 128 but you will likely find the examples and exercises helpful in understanding the material and, possibly, for completing assignment #3.

**Reference materials:** Slides:

**Pre-class exercise:** Select an information system or website that you interact with on a regular basis. Identify **two** data Entities from that system. Name the relationship between those Entities and describe the cardinality of the relationship.

NOTE: To make this exercise a bit more interesting than the one from the last class, you need to select different entities and relationships than those previously chosen by other students.

[Bob Monroe]
 * Website** : Qatar MOI Traffic Violations website
 * Entities** : Vehicle and Violation
 * Relationship** : a Vehicle is charged with a Violation
 * Cardinality** : One (Vehicle) to Many (Violation)

[M Hammad Abbasi]
 * System** : iTunes
 * Entities** : Users and Songs
 * Relationship** : a user owns a song
 * Cardinality** : One (User) to Many (Songs) [cannot be many songs to one user]

[Hind Al Khulaifi]
 * System** : HUB
 * Entities** : Student and Course
 * Relationship** : a student is assigned a course
 * Cardinality** : Many(student) to Many (Course)

[Al-Jawhra Al-Mana]
 * System:** Blackboard.
 * Entities:** Instructor and course.
 * Relationship:** An instructor offers a course.
 * Cardinality:** One (Instructor) to Many (Courses).

[Firas Bata]
 * Website:** eBay.com
 * Entities:** Customer and shoes
 * Relationship:** a Customer purchases a pair of shoes
 * Cardinality:** One (Customer) to Many (shoes)

[Fatima Al-Khayat]
 * website:** Hotel Online Reservation website.
 * Entities:** User and Reservation.
 * Relationship:** A user makes a reservation.
 * Cardinality:** One (user) to Many (Reservations).

[Maryam Al-Subaie]
 * Website:** Barnes & Noble
 * Entities:** Customer and Items
 * Relationship:** a Customer purchases Items
 * Cardinality:** One (Customer) to Many (Items)

[Maryam Al-Thani]
 * Website:** Amazon.com
 * Entities:** Customer and Book
 * Relationship:** a Customer purchases a Book
 * Cardinality:** One (Customer) to Many (Book)

[Mohammed Kamal]
 * Website:** www.qe.com.qa
 * Entities:** User and Stock
 * Relationship:** a User buys and sells a stock
 * Cardinality:** One (user) to Many (Stocks)

[Dua'a Althabatah]
 * System:** Qatar Airways Online Reservation Website
 * Entities:** Traveler and Reservation
 * Relationship:** A traveler makes a reservation
 * Cardinality:** One (Traveler) to Many (Reservations)

[Layal Al-Alami]
 * Website:** Apple.com
 * Entities:** Product and Customer
 * Relationship:** A Customer buys a Product
 * Cardinality:** One (Customer) to many (Products).

[Amal Osman]
 * Website**: tech4work.com
 * Entities:** Employer and Student
 * Relationship**: employers look for students to hire and vice versa
 * Cardinality:** Many (employer) to Many (student)

[Ayah Abujarbou]
 * Website**: Nike
 * Entities:** Product and Customer
 * Relationship**: customer buys products
 * Cardinality:** one (customer) to many (products)

[Ahmad Al-Sarraf]
 * Website**: QNB
 * Entities:** Customer and Bank Account
 * Relationship**: Customer checks Bank Account
 * Cardinality:** one (customer) to many (Bank Accounts)

[Jevika Shetty]
 * Website**: Myntra.com
 * Entities:** Customer and clothing product
 * Relationship**: Customer buys clothes (online)
 * Cardinality:** one (customer) to many (clothing products)

[Abdullrahman Al-Muftah]
 * Website**: Qtel.com
 * Entities:** Customer and Bill
 * Relationship**: Customer has to pay # of bills
 * Cardinality:** one (customer) to many (bills)

[Hussain Hejji]
 * Website**: CarSemsar.com
 * Entities:** Customer and Car
 * Relationship**: Customer buys used or new cars
 * Cardinality:** One (customer) to many (Car)

[Sara Al-Mannai]
 * Website**: FaceBook
 * Entities:** User and accounts
 * Relationship**: User creates several accounts
 * Cardinality:** One (User) to many (Accounts)

[Jim Briggs]
 * Website** : Google+
 * Entities** : User and status comment
 * Relationship** :A user can share status comments within their circle of friends
 * Cardinality** : One (User) to Many (Status comments)

[Khadeejah Al-Husseiny]
 * Website** : TartanTrek
 * Entities** : Student and Employer
 * Relationship** : A Student finds job from Employer
 * Cardinality** : Many (Students) to Many (Employers)

[Aisha Al-Zaman]
 * Website** : Gmail
 * Entities** : User and email address
 * Relationship** : user can have more than one email address
 * Cardinality** : One (user) to Many (email addresses)

[Walied El Hag Ali]
 * Website**: Htcphonestore.com
 * Entities**: Customer and Phone
 * Relationship**: A customer buys phones through the website
 * Cardinality**: One (Customer) to Many (Phones)

[Hamsa M Al-Massri]
 * Website**: www.curves.com
 * Entities**: Customer and Membership
 * Relationship**: a customer registers for a membership
 * Cardinality**: One (customer) to Many (types of membership)

[Mohammed Al-Rawahi]
 * Website**: Qfoody.com
 * Entities**: Restaurant and Customer
 * Relationship**: A customer orders from restaurant
 * Cardinality**: One (Customer) to one (Restaurant)

[Nasser Al-Khori]
 * Website**: Twitter
 * Entities**: User and accounts
 * Relationship**: A user starts an account
 * Cardinality**: one (user) to one (account)

[Fatima Abdulla]:
 * Website:** Zappos.com
 * Entities:** Items and Customers.
 * Relationship:** A customer buys an item.
 * Cardinality:** One (customer) to many (items).

[Nahan Arif]:
 * Website:** CMUQ Intranet
 * Entities:** Students and Accounts.
 * Relationship:** A student logs-in to their account.
 * Cardinality:** One (student) to one (account).

[Noor Al-Mohannadi]:
 * Website:** Net-a-porter.com
 * Entities:** Customer and products.
 * Relationship:** A customer buys a product.
 * Cardinality:** One (customer) to many (products).

[Mughees Ahmed]:
 * Website:** expedia.com
 * Entities:** Services, Products, Offers and Special packages.
 * Relationship:** Passengers book and reserve flights/hotels.
 * Cardinality:** One passenger/customer to many types of deals.

[Mohammed Hadi Takiddin]:
 * Website:** www.cmu.edu/hub
 * Entities:** Students and Grades.
 * Relationship:** Student log in and check their grades.
 * Cardinality:** One (student) to many (grades).

[Dalia Saleh Hassan]:
 * Website:** digital drop box
 * Entities:** Students and assigntments.
 * Relationship:**Student log in and check their assigntments.
 * Cardinality:** One (student) to many (Assigntments).

[Laura Jaber]:
 * Website:** megavideo.com
 * Entities:** users and memberships
 * Relationship:** users get memberships to have unlimited access to videos
 * Cardinality:** One (user) to many (videos).

[Najla Al-Madhadi]
 * System:** AlArabiya Airways Online Reservation Website
 * Entities:** passengers and Reservation
 * Relationship:** A passenger makes a reservation
 * Cardinality:** One (passenger) to Many (Reservations)

[Patrick Steinhagen]:
 * Website:** www.tumblr.com
 * Entities:** members and feeds
 * Relationship:** a user receives feeds from social networks
 * Cardinality:** One (user) to many (social networks).

[Anas Ali Chaudry]
 * Website:** Youtube
 * Entitites:** Users and Video uploaders
 * Relationship:** Users are able to watch the videos that the video uploaders have uploaded to the website.
 * Cardinality:** One (user) to many (videos)

[Fatima Fikree]
 * Website:** picnik.com
 * Entities:** Registered users and photos
 * Relationship:** Registered users are able to upload photos and edit them
 * Cardinality:** One (user) to many (photos)

[Ognjen Popovic]
 * Website:** mediafire.com
 * Entities:** Users and music
 * Relationship:** Users are able to download music
 * Cardinality:** One (user) to many (music tracks)

[Ahmed Al Ahmedani]
 * Website:** blogger.com
 * Entities:** Users and blog pages.
 * Relationship:** Users are able to create a blog page and read other blogs.
 * Cardinality:** One (user) to many (blogs)

[Mashael Al-Misnad]
 * Website:** saksfifthavenue.com
 * Entities:** Customers and items.
 * Relationship:** Customers buy clothing items.
 * Cardinality:** One (customer) to many (items)