The+Relational+Data+Model

Sunday, October 30, 2011 <>
 * The Relational Data Model**

In class today we will look at the Relational Data Model, which is a another way to model data requirements. The Relational Model is complementary to ER Diagrams in that it allows you to map the abstract ER model to a concrete set of relations that can be used to store your data in a Relational Database Management System (RDBMS) such as Oracle, SQL Server, MySQL, or Microsoft Access.
 * Topic overview: **

In class today we will look at the basic conceptual elements of the Relational Model and practice mapping ER diagrams into relations.

By the end of today's class you should be able to:


 * Understand what a //relation// is in the Relational Model, how it is similar to a //table// in a relational database, and how it differs from a //relationship// in an E-R Diagram
 * Be able to map entities and attributes to relations
 * Be able to map //relationships// in an E-R Diagram to //relations// in a relational model.
 * Understand how relations are used to define tables and store data in an RDBMS

**Preparation for class:** For class on Wednesday, you should read pages 201-223 of [HPT09]. You will need to be able to use the information in all of these pages to complete assignment #3, so it is worth your while to read the full reading. The reading for today's class is available on digital reserve through Blackboard in the Course Materials section.


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

Because this is a lot of technical reading the quiz will only cover material on pages 201-211. Pages 212 - 223 will make more sense after we have done some mapping exercises in class but the exercises will be a lot easier if you have at least tried to read and work through pages 212-223. Although the later pages of the chapter will not be on today's quiz, they are fair game for exam #2 and the final exam.

**Reference materials:** Slides:

Solutions to in-class exercises:

**Pre-class exercise:** Prior to class, do the following exercise by yourself: **NOTE: You do not need to post your answer to the wiki today, just do the exercise with pencil and paper. The process of drawing the ER diagrams and mapping them to relations should help you significantly to understand the concepts, and to bring good questions to class if you have trouble completing the exercise.**

Select one of the examples of two or three Entities from the slides in the previous class. Try to draw an ERD for the Entities and their Relationship(s). Add a few appropriate attributes to the Entities and then:

1) Draw an ER Diagram that includes the entities, the relationship(s), and the attributes for each entity (and/or attributes of the relationship if you would like)

2) Try to map those Entities, Attributes, and the Relationship(s) into a set of Relational Model //relations//. Use either of the notations for describing relations that are presented in today's reading.