CS145: Introduction to Databases
Course Information


Index


Course Goals

This course provides the student with an introduction to the design of databases and the use of database management systems for applications. We will cover object-oriented (O/O) and entity-relationship (E/R) approaches to database design. We will cover the relational data model, mappings from O/O and E/R designs to relations, relational design issues, and how one uses a relational database management system to implement a database. 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 databases. We will cover a variety of other issues important to database designers and users, including views, indexes, integrity constraints, triggers, and transactions. Finally, time permitting, we will consider advanced issues such as recursive queries, object-relational and object-oriented systems, data integration, data warehousing, and data mining.

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. This topic is covered in the follow-on courses CS245 (formerly CS245A) and CS346 (formerly CS245B).


Prerequisites

CS107 and CS109 are expected but not absolutely required. 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 CS109). Programming assignments will use the Oracle database management system and the C or C++ programming language, so we shall assume that students are proficient already with Unix and C. (C++ is not required, but it is allowed for those who prefer to use it.)


Books

The required text for the course is: A First Course in Database Systems by J. D. Ullman and J. Widom, Prentice-Hall, 1997.

The following book is recommended (but not required): A Guide to The SQL Standard by C. J. Date and H. Darwen, Addison-Wesley, 1997.


Time and Place

Tuesdays and Thursdays 11:00-12:15, Gates B03. Televised live on channel E4.

In addition, there will be an optional help session held on Mondays 2:15-3:05, Skilling 193, televised live on channel E2. The session will be conducted by the TA's and is entirely optional. During the session, the TA's may work problems and/or answer student questions, but they will not deliver a prepared lecture. If you attend the session (live or via television), please come armed with questions or discussion points.


Course Resources


Personnel

Instructor Jun Yang 
Office: Gates 419 
Phone: 725-3358
Office Hours: 
        TUE 9:45-10:45AM 
        THU 12:15-1:30PM 
        SUN 3:45-4:45PM
TA Erik Haugen 
Office: Gates 193 
Phone: TBD
Office Hours: 
        MON 3:10-5:10PM 
Office Hours in Sweet Hall: 
        THU 9:00-11:00PM
TA Charity Lu 
Office: Gates 193D 
Phone: 725-3256
Office Hours: 
        WED 10:00AM-12:00PM 
        THU 2:30-4:20PM
TA Mark Pearson 
Office: Gates 193A 
Phone: 723-6059
Office Hours: 
        TUE 1:30-3:00PM 
Office Hours in Sweet Hall: 
        FRI 2:15-3:45PM
TA Michael Sawka 
Office: TBD 
Phone: TBD
Office Hours: 
        TBD
Grader Ramana Yerneni
Secretary Marianne Siroker 
Office: Gates 436 
Phone: 723-0872


Unix and Oracle Accounts

Programming assignments will use the Oracle relational database management system (version 8.0.4) and the C or C++ programming language. Oracle and C/C++ are available on leland machines running Solaris version 2.6, such as elaine, epic, and saga. These machines are located on the second floor of Sweet Hall. To open an account on leland machines (if you do not have one already), type open at the login: prompt and follow the instructions. SITN students can access the Sun workstations remotely via dial-in (325-1010) or telnet. We assume that students are proficient with Unix and C or C++.

During the first lecture, we will pass around a sign-up sheet for Oracle accounts. If you missed the first lecture, send an email containing your leland login name to cs145@cs.stanford.edu in order to get your Oracle account set up.

If you have one available, you may use a system other than Stanford's Oracle, or you may use a non-standard interface to Oracle (e.g., through ODBC or JDBC). Be warned, however: You are responsible for ensuring that the system and/or interface you use supports all the same features as Oracle version 8.0.4. Those features include but are not limited to support for interactive and embedded full-feature SQL, indexes, transactions, authorization, views, constraints, and triggers. If you use a different system and then discovers that it does not offer the features needed for the class, you will need to port your project to the Stanford Oracle system at that time. We will not be able to provide support or answer system-specific questions for any system or interface other than Stanford's Oracle C/C++ system.


Web, News, and Email

The course web page is located at http://www.stanford.edu/class/cs145/. All handouts will be linked to the web page. Hard copies of the handouts can be found at the "handout hangout" between the A and B wings on the 4th floor of Gates. Whatever is not picked up in class will appear there, but we will not restock the supply once it is gone.

The course newsgroup is su.class.cs145. The newsgroup is accessible from any Unix machine on campus via the NNTP server nttp.stanford.edu. Please check the course newsgroup frequently---we will assume that all students are reading the newsgroup at least every couple of days, and we will not hesitate to make important announcements via the newsgroup. If you are unable to read the newsgroup or prefer to receive news messages as emails, please run /usr/class/cs145/bin/news-subscribe from leland machines to set up your subscription. (To unsubscribe, run /usr/class/cs145/bin/news-unsubscribe.)

All questions or messages from students that could be of general interest to the class should be posted to the newsgroup. This includes, for example, any technical questions regarding lecture material, reading, homework problems, upcoming exams, etc. We very much encourage students in the class to post responses to questions. We will monitor the newsgroup regularly, and post responses to questions that have not previously been asked or answered. Before sending a question, please do make sure that you've read all previous news messages and that your question has not yet been discussed. To post a message, either use your favorite newsreader or run /usr/class/cs145/bin/news-post from leland machines.

Private email regarding the course should be sent to cs145@cs.stanford.edu. This address is only for questions applying to an individual student (e.g., my Oracle password seems to have changed, or I didn't get back my graded assignment). These messages will be read by course staff.

You could also email individual TA's or the instructor directly. However, private email addresses will not be monitored for course-related messages, so there may be significant delay.


Course Requirements


Assignments

There will be seven written assignments (WA's) and five programming assignments (PA's). Both WA and PA will be given on Thursdays. There will be assignments due every full week except the first one and the week of the midterm exam.

Submission Instructions and Late Policy

On-campus students: WA is due at 5:00 PM on Thursday (a week after it is assigned). It should be turned in during class or at the course secretary's office, Gates 436. PA is due at 11:59 PM on the date specified in the assignment handout. It should be turned in electronically; see /usr/class/cs145/bin/submit-README for instructions. Late submissions will not be graded.

SITN students: The policy for PA is the same as for on-campus students as specified above. For WA, assignments due on Thursday must be timestamped by the Friday courier; assignments timestamped later than Friday will not be accepted.

For emergencies: Each student is allocated two "chits". One chit may be used to turn in a WA on the Monday after its due date; or it may be used to turn in a PA up to three days late. Two chits cannot be applied to the same assignment. We will keep track of your chits automatically.

Graded Assignments and Sample Solutions

Graded WA's will be available outside the course secretary's office, Gates 436. SITN WA's will be returned via couriers. WA sample solutions will be posted on the class Web page. PA grades will be emailed to individual students directly.

The course staff will try to grade and return all assignments within 7 to 12 days after they are submitted. Since there are nearly 200 students in the class, sometimes it might not be possible to return everything within a week. Please be understanding when delays happen occasionally.


Examinations

The midterm exam will be held on Thursday April 29 11:00 AM-12:15 PM in Kresge Auditorium. The final exam will be held on Tuesday June 8 at 3:30-6:30 PM in TCSEQ (Teaching Center at the Science and Engineering Quad), Lecture Hall 200. All on-campus and SITN students must attend the midterm and final exams on the Stanford campus at the scheduled time and place.


Grading and Honor Code

Written assignments 15%
Programming assignments 30%
Midterm exam 20%
Final exam 35%
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 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.


Tentative Syllabus

Week Date Topic Reading
1 March 30 Intro, E/R model 1
April 1 More E/R 2.2-2.6
2 April 6 ODL 2.1, 2.3-2.5
April 8 Relational model & design 3.1-3.4
3 April 13 FD's and BCNF 3.5-3.6, 3.7.1-3.7.5
April 15 Relational algebra 4.1
4 April 20 SQL: SPJ queries 5.1-5.7
April 22 SQL: subqueries, aggregates, modification
5 April 27 SQL: tables, keys, views, indexes 5.8
April 29 Midterm exam
6 May 4 SQL: NULL's, constraints, triggers 5.9, 6
May 6 SQL: programming 7.1
7 May 11 SQL: transactions 7.2
May 13 SQL3: object-relational features 8.5-8.6
8 May 18 SQL3: recursion 5.10
May 20 SQL3: recursion (cont'd)
9 May 25 Theory of decomposition, 3NF, MVD's, 4NF 3.7.5-3.7.7, 3.8
May 27 ODL 8.1-8.3, 8.7
10 June 1 Warehousing, mining, XML/XQL, search engines
11 June 8 Final exam

Jun Yang CS145 Spring 1999