Introduction to Data Management

(a.k.a. Computer Applications in Business: Databases)

CS 338 Waterloo, Fall '03

  Instructor:           David Toman (
  Office:               DC 3128 (Tue 2-3pm or by appointment)
  Lectures:             Tue-Thu 8:30-10 am MC 4061
  Class Info:

    Hashemian, Seyyed Vahid  MC4019F 12:00-1:00  Mon
    Kaastra, Mike      DC3324   2:00-3:00  Thu
    Zhang, Jie (Jane)     MC4024  11:00-12:00 Wed

Synopsis and Overview

The lectures try to give an answer the following three questions:
  • why do we want to use databases and what are the benefits of doing so,
  • how do we use databases as users and application programmers, and
  • how do databases work (an executive overview).

  • Assignments:

  • Assignment 1 (PDF; due: Oct 07, 2003),
    Assignment 2 (PDF; due: Oct 30, 2003),
    Submission Instructions: Each student should submit:

    • written solutions to questions 1-5 in relational calculus,
    • 8 files using the submit program; the files must be called q1.sql to q7.sql and a file id.txt which contains the information about the student. This file should contain three lines:
      1st line: [Last name], [First and Middle name]
      2nd line: [UWID]
      3rd line: [UW Student No.]
      Files q1.sql to q7.sql should contain queries as the answer to questions 1 to 7 in the assignment, respectively.
    • a printout of all the 8 files, using id.txt as a cover sheet for the whole assignment.

    Each subitted .sql file which can not be run under db2 successfully gets a substantially reduced mark.

    Use the "submit cs338 2 ." command in a directory containing the required q1.sql to q7.sql and id.txt files (for more on using submit use "submit -help").

    Assignment 3 (PDF; due: Nov 27, 2003),
  • Assignments will be collected in class on due date (often an electronic submission will be required). As the solutions may (and often will) be discussed on the due date in class, no late assignments will be accepted.


  • Midterm: 10/23 in class (8:30-9:50 a.m., MC 4061)

    Chapters in the textbook that cover material on the midterm

    1, 2.1-2, 3, 4.1-3, 7.1-4, 8.2-5, 9.1-3 (in the 3rd ed.)
    1, 2.1-2, 3.1-7, 4.1-3, 5.1-2, 6.1-3, 6.6, 7.1-2, 8.1, 8.4-6, 9.2 (in the 4th ed.)

  • Final: scheduled by the registrar: 12/16 9-12a.m. in PAC 9,10
    Chapters in the textbook that cover material on the final

    7.3, 8.6, 14.1-5, 15.1-2, 15.4, 18.1-4, 19.1-6, 20.1, 21.1, 21.3 (in the 3rd ed.)
    5.3, 8.2, 10.1-5, 11.1-3, 11.5, 15.1, 15.3-4, 15.6-8, 17.1-6, 18.1, 19.1, 19.3 (in the 4th ed.)

    Note: the final covers midterm material as well as the above listed chapters.

  • Lecture Schedule and notes (by week of classes):

    1. Introduction to Databases
    2. Data Models and Basic ER modeling (.pdf)
    3. Relational Model (.pdf), ER to relational (.pdf)
    4. Relational Algebra (.pdf), DB2 tutorial (.pdf) SQL Queries I (.pdf) Sample Database, Samples (Results)
    5. SQL Queries II (.pdf), Samples (Results), SQL Queries III (.pdf) Samples (Results)
    6. SQL Updates (.pdf), Sample Database copy-to-your-account file, Samples (Results), Static Embedded SQL (.pdf) Samples
    7. review for midterm and MIDTERM (10/23 in class))
    8. More on Application Development: Dymamic Embedded SQL (.pdf) and ODBC (.pdf)
    9. More on Schema design: Integrity Constraints and Normal Forms (.pdf) and Integrity Constraints and Normal Forms, Part II (.pdf)
    10. Query Processing in Relational Systems (.pdf) and Query Optimization (.pdf).
    11. Transaction Management (.pdf) and Recovery (.pdf).
    12. slack and review for final


    The lectures do not assume any prior knowledge of databases. However, you must brush up your skills in the following three areas:
  • Elementary math (sets, relations, first-order logic).
  • Basics of complexity theory (e.g., the O-notation, etc.).
  • Basic programming skills.

  • Book(s)

    Required: Fundamentals of Database Systems (3rd or 4th ed.) Elmasri and Navathe, Addison Wesley.
    References: Database and Knowledge-Base Systems I., II. Jeff Ullman. Comp. Sci. Press, 1988.
    Database Management Systems. Raghu Ramakrishnan. McGraw Hill, 1997.
    Foundations of Databases. S. Abiteboul, R. Hull, V. Vianu, Addison-Wesley, 1995.

    The lectures do not follow the textbook to the letter.


    AssignmentsMidterm Final Exam
    CS 338: 20% 35% 45%

    To pass the course, you must pass the final examination.

    Fine print: the usual university policies on academic honesty, fair use of computing facilities, etc., apply by default.