The best way to prepare for the exam is to do the exercises at the end of the chapter. I have been giving out the exercise numbers in each of the chapters tha tyou should work out. Solutions to the odd numbered exercises can be found in off the dbbook website.
CS564 in Fall 2006 had two midterms. Here is the first one, and here is the second one.