1. Goals for this week

  1. Cover Quiz 1 logistics and tips

  2. Overview of SQLite relational database software

  3. Checkpoint Lab 2: SwatDB Buffer Manager, then continue work and ask questions

2. Quiz 1

Quiz 1 will be available for you to take on gradescope.

You get 60 minutes to complete the quiz. Time starts as soon as you start the quiz, and your time will cut off 60 minutes after you start, so be sure to start when you have 60 minutes to take it.

You may take it anytime the quiz is open. It will be open for 18 hours for you to take, from 5pm Wednesday Sept. 30 through 11am on Thursday October 30. All submissions will cut off at exactly 11:00am on Thursday, even if you have time remaining. Be sure to start it by 10am Thursday if you want a full 60 minutes to take it.

The professors will not be able to answer questions during the quiz out of fairness to all students.

You will have to upload a file with your you answer for at least one quiz answer, so be ready for this before you start.

2.1. Allowable Materials/Integrity

  • Permitted materials: the course textbook, your course notes, and course webpage resources (e.g., slides, lab writeups, Piazza posts, lecture videos).

  • Prohibited materials: communication with any other person; you may not use internet material (e.g., web searches, youtube videos, Wikipedia) other than the course webpage. You are not permitted to communicate with any other person about the contents of this quiz during the entire time period the Quiz is open (5 pm on 9/30 through 11 am on 10/1).

  • You must affirm your understanding of our policy twice on the quiz to receive a grade.

    • At beginning, you will see something like this:

      I have read the above instructions and agree that I am only using permitted materials and that I am not engaging in any prohibited activities. Failure to abide is a violation of the course Academic Integrity Policy. I will reaffirm at the end of the quiz.

      ( ) I have read these instructions and rules and agree to follow them

    • At the end, you must sign that you did not violate the academic integrity policy

      By typing my name in the box below, I affirm that I did not violate the course policies or quiz policies while taking this quiz. All of the work on this quiz is my own.

2.2. Quiz taking tips

  • plan a place and time to take the quiz where it is quiet and you will be free of distractions

  • be sure to have scratch paper

  • have a plan for uploading an image. We recommend a dark pen with blank white paper. Practice taking a photo and making it available for upload (e.g., airdrop, dropbox, drive, email, etc.)

    • upload an image of your solution (not a raw drawio xml source, for example). You can view your submission, so check that it is an image of your solution. We will grade what we see.

    • for any figure, make sure important parts are clear. For example, if we have you draw an ER diagram and there is a participation constraint it should be obvious that the line representing it is thicker than lines that do not have participation constraints. We will not guess what you mean if we cannot read your solution; if we can’t read it, it is not correct. Be sure not to lose points because your answer is not readable.

  • have permitted materials handy so you aren’t waisting time looking for information

  • there shouldn’t be time pressure, but there isn’t a lot of buffer time to look up your notes, so skip questions you aren’t sure about and come back

  • to the extent possible, remove prohibited materials from your quiz-taking location

3. SQLite Tutorial

Open the SQLite tutorial.

4. Lab 2: SwatDB Buffer Manager

The rest of lab today will be for working on Lab 2: SwatDB Buffer Manager. Go to slack #labX channel and start a zoom session, and work on Lab 2: SwatDB Buffer Manager.

We will come around and ask you to run your checkpoint for us and answer other questions about the lab.


  # or to run individual tests
  ./checkpt -s BufMapTest

  # list them
  ./checkpt -h

4.1. Some resources that will help with next steps:

  • Look at the SwatDB Exceptions documentation off the SwatDB info page. It has examples of throwing and catching SwatDB exceptions, and links to the exception class documentation.

  • Refer to the Lab assignment page often for information, tips, about implementing and testing your solution.

    • Refer to the Testing part of the assignment page for some testing tips. Look at the note about the print methods of the BufferManager class to print out information about its state. You can call these from any of the test programs, or from within gdb.

    • Refer to the Details part of the assignment page for more verbose information about the methods you need to implement.

    • Also, look at bufmgr.h for types, parameters, return values, and the SwatDB section for links to documetnation on other parts of SwatDB that is particularly useful for this lab (SwatDB types and the Disk Manager interface).

  • Use gdb to debug your code. If you don’t know what a method you wrote is doing, run the test program (sandbox, unittest, checkpt) in gdb, set break points in BufferManager methods and examine runtime state.

  • Use valgrind to make sure any bugs you have are not due to memory access errors.

4.2. C++ Reminders

Look at the Wed Lab from Week 1 and Wed Lab from Week 3 pages for reminders about specify C++ programming and debugging tools and example programs we tried out for practice.

In particular, if you are still a bit rusty using gdb and valgrind, take some time to review them again so you are comfortable using them to debug this lab. It will save you hours and hours of debugging time to uses these tools, and we will ask you what you discovered from gdb and valgrind about bugs you have in your program that you want us to help you with--we expect that you are using gdb and valgrind to debug.

The Lab 2: SwatDB Buffer Manager assignment page has links to all kinds of C++ programming resources.