CS145 - Introduction to Databases
Spring 2000, Prof. Widom

Course Information

The course Web site will be accessible as http://cs145.stanford.edu.

Index into this document

Course Content

CS145 provides the student with a comprehensive introduction to the design of databases and the use of database management systems for applications. We will cover the entity-relationship (E/R) and relational data models and approaches to database design, including functional dependencies and normal forms. Abstract query languages such as relational algebra will be discussed, along with extensive coverage of SQL - the standard language for creating, querying, and modifying relational and object-relational databases. We will cover a variety of other issues important to database designers and users, including views, integrity constraints, triggers, transactions, and security. We will also cover object-oriented database design and query languages including the ODMG standard. Finally, time permitting, we will consider advanced topics such as data warehouses, data mining, XML, and Web/database interactions. Written work in all topics is complemented by a comprehensive, individual database application programming project.

This course is aimed at database design and use, and the implementation of database applications. It does not cover the implementation of database management systems. The latter topic is covered in the follow-on courses CS245 and CS346.

Course Personnel

Time and Place

The course meets Mondays and Wednesdays, 11:00-12:15, in Gates B01 (Hewlett-Packard Auditorium).

There will also be a help session most weeks on Friday, 3:15-4:05, in McCullough 150 (televised live on channel E3). The session will be conducted by one of the TA's and is optional but recommended. During the session, the TA will work problems and/or answer student questions, but the TA will not deliver a prepared lecture.


These prerequisites are a guide but not an absolute requirement. CS145 should be accessible to anyone with a solid Computer Science foundation that includes a reasonable amount of programming (as in CS107) and knowledge of basic Computer Science theory (as in CS103/CS109). For the programming project, we will assume prior knowledge of Unix and C.


There is one required book for the course: Students may also opt to purchase a book about the SQL database language, although you should be aware that Oracle's version of SQL, which we will be using, may differ slightly. One reasonably good SQL guide is: There are numerous other books on SQL available, as well as an entire shelf at the Stanford Bookstore devoted to books on Oracle. Copies of the textbook and the SQL guide mentioned above are on reserve at the Math and CS library (Building 380, 4th floor).

Lines of Communication

All inquiries regarding the course should be sent to cs145-staff@cs.stanford.edu. This address is monitored continuously by the course staff. CS145-related messages sent directly to the instructor or to a TA will not be handled. In the case where a message is intended for a specific staff member, the message should still be sent to cs145-staff@cs, indicating the intended recipient. The message will be forwarded accordingly.

We will also maintain a class mailing list, cs145-all@lists.stanford.edu. This list will be used primarily for the staff to communicate with the students, although students may feel free to post on this list as well. We require all students to place themselves on this mailing list, and we will not hesitate to use the list to convey important and timely information. To sign up for the list, send a message to majordomo@lists.stanford.edu with "subscribe cs145-all" as the body of the message. Be sure to send the message from your preferred mail-reading host.

To keep the volume of email manageable, we will maintain comprehensive and up-to-date Frequently-Asked Question (FAQ) lists, linked to the course home page. There will be a general FAQ, as well as a FAQ for each assignment and exam. Before sending an inquiry to cs145-staff@cs or cs145-all@lists, please be sure to review the relevant FAQs.

Written Assignments

There will be seven written assignments. Written assignments will be given out on Wednesdays and will be due the following Wednesday. There will be a written assignment due every full week except the first one and the week of the midterm exam. Written assignments should be turned in during class or at the course secretary's office: Gates Building room 436.

Programming Project

A main component of CS145 is that everyone creates their own significant database application from scratch. The project is divided into seven parts. You will start by selecting your application, then designing the database, obtaining and loading your data into a real database management system, and writing a number of SQL queries, client programs with embedded SQL queries, and exercising other features of SQL. New this year, as the final part of the project you will create a simple Web interface to your database application.

Project parts will be assigned on Mondays and will be due the following Monday (with the exception of the last part, which is due on a Wednesday). There will be a project part due every full week except the first one and the last one. Most parts of the project will either be written (the first two parts), or scripts will be turned in on paper; some parts may be turned in electronically. Parts not submitted electronically should be turned in during class or at the course secretary's office: Gates Building room 436.

The programming portion of the project will use the Oracle relational database management system (Oracle 8i, version 8.1.5), the Unix operating system, and the C, C++, and/or Java programming language. Oracle, C/C++, and Java are available on the Sun Solaris workstations on the second floor of Sweet Hall, e.g., the elaine and epic machines. To open an account on these machines, type open at the login: prompt and follow the instructions. SITN students can access the Sun workstations remotely via dial-in or telnet. We will assume that students are proficient already with Unix and C. C++ and Java are not required, but may be allowed (logistics permitting) for those who wish to use them.

If you have access to an Oracle 8i system including PL/SQL and Pro*C, you may use it instead of the Stanford system. However, we do expect you to use Oracle and not some other DBMS - not because we love Oracle, but because we are going to be exploring some very specific capabilities of this system. If you choose to use your own workstation and/or your own Oracle system, please be aware that we cannot make any exceptions for problems incurred by using your own computing facilities rather than those provided by Stanford.

Opportunities to Shine

It's easy to get lost in a class of 100-200 students, and it's easy for the course staff to lose track of the truly motivated and outstanding students. We're instituting three mechanisms geared to give students an opportunity to shine: student grading, project contest, and A+ letter-and-lunch.

Student grading

We will hire students from the class to assist in grading the written assignments. If you sign on to be a student grader you can expect three rewards: Grading sessions will be conducted by one of the TA's and will be held weekly starting in the late afternoon. Dinner will be provided, and students will be paid at the usual hourly grader rate ($11.50-$12.50 per hour; check with Claire Stager, stager@cs.stanford.edu, for details and visa restrictions). If you are interested in being a student grader, please send a message to cs145-staff@cs.stanford.edu indicating your interest, and listing the Computer Science courses you have taken at Stanford and the grade you received in each one. Graders will be retained throughout the course provided they do a good job with grading and maintain a good standing in the course.

Project contest

At the end of the course we will select the four best projects as contest winners. Admittedly the decision of which project is "best" is by nature subjective, but we will do our utmost to select the four projects that we believe are the most interesting, novel, challenging, and robust. The benefits of winning are:

A+ letter-and-lunch

Students earning an A+ in the course will receive a personal letter of congratulations from the instructor, along with an invitation to enjoy lunch with the instructor and the other A+ students at the Stanford faculty club. The A+ students also will be top candidates for CS145 TA positions in subsequent offerings of the course.

Late Policy



The midterm exam will be held on Wednesday May 3, in class at the regular time. The final exam will be held on Monday June 5 from 8:30-11:30 AM (location to be announced). Alternative or make-up exams will not be given. All on-campus and SITN students must attend the midterm and final exams on the Stanford campus at the scheduled time and place.


The components of the final grade will be distributed as follows:

Honor Code

Under the Honor Code at Stanford, each of you is expected to submit your own work in this course, including written assignments, programming assignments, and exams. On many occasions when working on assignments it is useful to ask others (the instructor, the TA's, or other students) for hints or debugging help, or to talk generally about the written problems or programming strategies. Such activity is both acceptable and encouraged, but you must indicate on both your written and your programming assignments any assistance (human or otherwise) that you received. Any assistance received that is not given proper citation will be considered a violation of the Honor Code. In any event, you are responsible for understanding and being able to explain on your own all written and programming solutions that you submit. The course staff will pursue aggressively all suspected cases of Honor Code violations, and they will be handled through official University channels.

If you have any questions about this policy or about the degree to which we will pursue Honor Code violations, please discuss your concerns with the course staff immediately.

Special Note for SITN Students

While we understand the significant demands of taking a course while working, we would like to make it clear at the outset that no special exceptions can be made for SITN students. Local SITN students must follow the lectures, turn in the assignments, and attend the exams on exactly the same schedule as on-campus students. Please ensure in advance that you will not have any business trips or important deadlines that conflict with the course, since no exceptions will be made. Also note that like on-campus students, for emergencies you are allocated four unpenalized late days for assignments (see late policy).