CSC 381: Database and File Systems, Fall 2007
Assignments
-
Tuesday, September 4:
- Chapter 2, Exercises 1, 2, 3, and 7
Chapter 3, Exercises 2 and 9
-
Thursday, September 13:
- Chapter 4, Exercises 1, 4, 8, 9, and 20(a, e, i, m, and q)
-
Thursday, September 27:
- Chapter 8, Exercise 2 (just do query 4.20q). That is, "Write a (Java) program using Derby that executes the following
query and prints its output table: retrieve the STUDENT record of the students who never received a grade of A in any
course they took in their major." I suggest you start by checking out the "StudentClientDerby" project from
http://twiki.csc.depauw.edu/svn/csc381/USERNAME
(you should have committed this project to your personal
subversion branch in class on Thursday, September 20 -- if not, check it out of .../public, then choose "Branch/Tag..."
from the "Team" menu and move your working copy into your own branch by changing "public" to your USERNAME in the "To:"
field). Start the Derby network server, and run the "CreateStudentDB" client. Then write your program to perform the
above query based on the "StudentMajor" client in that project (you could just make a copy of StudentMajor.java and work
from there). When you are done, make sure to do a "Commit..." from the "Team" menu and it will be saved on the subversion
repository.
-
Tuesday, October 23:
- The SimpleDB buffer manager currently uses the naïve replacement strategy, choosing the first unpinned buffer it finds.
Also, it does a sequential scan to see whether a block is already located in a buffer. For this project, you should modify the
buffer manager (in package
simpledb.buffer
) to improve on both of these situations.
- Modify
BasicBufferMgr
to implement the LRU replacement strategy. Keep a queue of unpinned buffers. When a
buffer needs to be replaced, choose the one at the head of the queue. When a buffer becomes unpinned, add it to the end of
the queue.
- Also modify
BasicBufferMgr
to keep a Map<Block, Buffer>
of allocated buffers, indexed by
the block each contains (a buffer is "allocated" if it contains a block, whether it is currently pinned or not). When a
request comes to pin a block, use the map to determine whether it is currently in a buffer. You will need to update this
map when buffers are replaced. See the Java API documentation on maps
for details on how to use them.
When you are finished, be sure to commit your changes back to your branch of the subversion repository.
-
Tuesday, November 6:
- Chapter 14, Exercises 3, 7, 16, 18, 21, 23, 25, and 31
-
Thursday,
November 29 December 6:
- Do Chapter 20, Exercise 5, which requires that you also do Exercises 17.19 and 15.10 (note there is a typo in 17.19: it refers
to Exercise 15.6 when it should say 15.10). Be sure to commit your changes (including your test program) back to your branch of the
subversion repository.
DePauw University,
Computer Science Department,
Fall 2007
Maintained by Brian Howard
(bhoward@depauw.edu
).
Last updated