CS145 Introduction to Databases

NVIDIA Auditorium on TTh 3:00-4:20pm

Chat with us on the course Piazza site if you have any questions!

This course covers database design and the use of databases in applications, with a short introduction to the internals of relational database engines. It includes extensive coverage of the relational model, relational algebra, and SQL. The course also features database design and relational design principles based on dependencies and normal forms. Many additional key database topics from the design and application-building perspective are also covered, including indexes, views, transactions, and integrity constraints. Systems such as MapReduce framework and key-value stores will also be covered. There will be a programming project, which explores database design and management in web applications by utilizing appropriate features of SQL.
Class Logistics

We're excited to once again utilize Jupyter notebooks to allow for more interactivity in the class. Installation instructions are available here. Python is used in the in-class activities, homework and projects.

For the attendance portion of the class (SCPD students are exempt from this), we will write a code on the board during class. From your primary stanford email, send a note to 145attendance@gmail.com with the code in the Subject Line of the email. Do not write anything other than the code in the subject line and make sure that the body of the email is empty.

Lecture Plan

The reading material listed below is optional, but it refers to Database Systems: The Complete Book by Garcia-Molina, Ullman, and Widom. The lecture plan below may change.

# Date Topic Lecture Materials Extra Reading Material Assignments
Introduction and Querying
1 9/27 Course Logistics and Database History Lecture 1 (pdf)

Notebook data: dataset_1.db
2 9/29 SQL: Introduction Lecture 2-3 (pdf)

Activities: Notebook data: dataset_1.db
Greenspun- SQL for web nerds PS #1:
  • Coming soon...
3 10/4 SQL: Advanced Ch. 6
Database Design and Normal Forms
4 10/6 Database Design: ER Diagrams Lecture 4

Ch. 2 Project Part 1
  • Coming soon...
5 10/11 Database Design: Theory 1 Lectures 5-6

  • Coming soon...
Ch. 3.2-3.7 PS #1 Due
6 10/13 Database Design: Theory 2 PS #2:
  • Coming soon...
7 10/18 Transactions from a User's Perspective Lecture 7-8

  • Coming soon...
Ch. 8.6 Project Part 1 Due
8 10/20 Mechanisms for Transactions: Logging and Locking Ch. 18.1-18.4
9 10/25 Midterm Review PS #2 Due
10 10/27 Midterm
Location: NVIDIA and Hewlett 200 (overflow)
11 11/1 Guest Lecture: Hakan Hacigumus, Google Ads
Introduction to Database Internals
12 11/3 IO Cost Models and External Sort Lecture 12

  • Coming soon...
Ch. 11.4 Project Part 2
  • Coming soon...
13 11/8 Indexing Lecture 13

  • Coming soon...
Ch. 13.1-13.3
14 11/10 Access Methods and Operators Lectures 14-15

  • Coming soon...
Ch. 15 (except 15.9)
15 11/15 Joins: A Cage Match Ch. 2 and 16.3 Project Part 2 Due

Project Part 3
  • Coming soon...
PS #3:
  • Coming soon...
16 11/17 Relational Algebra Lecture 16

  • Coming soon...
Ch. 2 and 16.3
Thanksgiving Break: 11/21-11/25
17 11/29 Query Optimization Lecture 17

  • Coming soon...
NoSQL Systems
18 12/1 Guest Lecture: Matei Zaharia, InfoLab Faculty and Spark Cocreator PS #3 Due
19 12/6 Research Talk: Dark Data and Analytics Systems Lecture 19

  • Coming soon...
Wrap up and Final
20 12/8 Final Exam Review Project Part 3 Due

Change log:
Note: you may have to clear your browser's cache to get newest files!
    9/25/16 3:00pm - Lectures 1, 2, and 3 Updated
Midterm Exam
The midterm exam will be in class on October 27th from 3:00pm - 4:20pm. The locations will be:
  • NVIDIA Auditorium
  • Hewlett 200
Hewlett 200 will be the overflow room
Lecture Attendance10%
Problem Sets20%
Programming Project20%

Note: SCPD students will be exempt from the "Lecture Attendance" portion. Grading will be scaled proportionately over the remaining segments.

Office Hours

Unless otherwise specified in the staff section below, office hours will be held in the open area of the Huang basement. CAs will bring signs to identify themselves. Please see the staff section below for office hours.

Note: the schedule of office hours may change from time to time, in which case an announcement will be made on the course Piazza.

Tara Balakrishnan
Adam Ginzberg
Amani Peddada
Connie Zeng
Don Mai
Helen Fang
Krister Johnson
Lindsey Kostas
Luda Zhao
Russel Stewart
Senthilnathan Viswanathan
Late Policy
You will have three 24-hour "late days" that you can use throughout the quarter on any of the Problem Sets or Programming Projects, unless specified otherwise. Beyond these three late days, we will only grant extensions in the case of a severe medical or family emergency. Please use your late days wisely.
Honor Code and Collaboration Policy

We encourage you to discuss the Programming Projects and Problem Sets with other students; it's fine to discuss overall strategy and collaborate with a partner or in a small group, as both giving and receiving advice will help you to learn.

However, for the Programming Projects, you must write your own code: it's not OK to share code or write code collaboratively. (This includes posting and/or sharing your code publicly, such as on GitHub!) Likewise, for the Problem Sets, you must write up your own solutions to all of the problems, and you must cite all people you worked with. If you do not do so, we will consider this a violation of the Stanford Honor Code.

If you consult any resources outside of the materials provided in class, you must cite these sources. We reserve the right to assign a penalty if your answers are substantially derivative, but, as long as you provide appropriate citations, we will not consider this an Honor Code violation.

Students with Documented Disabilities
Students who may need an academic accommodation based on the impact of a disability must initiate the request through the Office of Accessible Education (OAE). OAE staff will evaluate the request with required documentation, recommend reasonable accommodations, and prepare an Accommodation Letter for faculty dated in the current quarter in which the request is being made. Students should contact OAE as soon as possible since timely notice is needed to coordinate accommodations: 563 Salvatierra Walk; phone: (650) 723-1066.