CSCI A114 / INFO I111
Lecture Notes Four

First semester 2001-2002


Designing databases in the relational model.

Today in class we will be going over labs

Lab 3 is mostly maintenance: Lab 4 creates two reports and a form. Next we review the relational data model as a basis for data definition and data manipulation.

The Relational Data Model

In this model data is represented as tables and only as tables.

We use the entity-relationship model to design a relational database. This model does an adequate, albeit imperfect, job of modeling real-world situations, such as business enterprises or the records kept by schools, hospitals, governments, and so on, where database systems are likely to be used. However, if we view the structures defined in the entity-relationship model as conceptual schemes, we shall not be grossly deceived so this is a good starting point for your design.

We will have the following recipe:

  1. first list the entities, with attributes
  2. then list the relationships Make a table for each entity, identify the key attributes.

    Make a table for each relationship, in which

    Here's an example.

    Suppose we have a list of tennis tournaments:

    Suppose we also have a list of tennis players: Let's design a database in which we can store the information that Here's the entity-relationship diagram.

    We will have three tables.

    Each table has two columns.

    If a column is in color it is a key, or part of a key.

    Create the tables and populate the database.

    Then create three queries:

    Now solve a similar problem, as follows.

    Design a database in which you could store information about the following information.

    Identify the entities (and their attributes), the relationships (and their attributes) draw the entity relationship diagram, then create their tables and then populate the database.

    You're now ready for the next homework assignment, due Wednesday in lab.


    Last updated: September 4, 2001 by Adrian German for A114/I111