CMPS 340 Fall 2008
Test #1 Study Guide
Anticipate questions of the following kinds:
- Disks and Data Organization (Chapter 13, Sections 1-7, 10)
- Double Buffering: be able to explain what benefits it offers
over single buffering. Also, given the ratio between the speed
at which a program "consumes" the data in an (input) buffer and
the speed at which a buffer is filled (by the I/O system), estimate
what percentage of the time the program is waiting for an input
buffer to fill up.
(See Figure 13.4 in Elmasri & Navathe.)
- Given a file's size (in terms of number of buckets it occupies) and
disk drive characteristics (average seek time, etc.), calculate
the time needed to perform a binary search in the file (which is
just the expected number of bucket fetches multiplied by the time
to fetch a bucket).
- Given a description of a file (number of records, length of records),
a distribution of file operations (e.g., 99% single-record fetches,
1% exhaustive sequential reads), and disk drive characteristics
(e.g., sector size, average seek time, sector transfer time, etc.),
calculate the optimal size for buckets.
- Given a description of how records and metadata in a bucket are
laid out, as well as a description of the particular records in
a bucket (e.g., Name: John Gorn, Birthdate: 5/12/1987, etc.),
show the contents of the bucket. Also supply code for calculating
the location, within a bucket, of the byte at which a specified
record begins.
- (Flat) Indexes (Chapter 14, section 1 and sub-section 5.2)
- Know the differences between primary, clustering,
and secondary indexes, and be able to show an index
corresponding to given data in blocks/buckets.
- Explain the tradeoffs between using logical pointers
as the "reference" values in an index versus using
physical pointers.
- Sequential File Update
- Given a master file and a transaction file, be able to
"manually execute" the Balanced Line Algorithm in order
to generate the updated master file.
- How would you implement the unGet() operation that's
used in the Balanced Line Algorithm.
- cosequential processing: be able to adapt the classic algorithm
for merging ordered sequences to solve a similar problem.
- Relational Database (Chapter 3, sections 1-7, Section 7.1,
Sections 5.1-5.2, Sections 6.1-6.5)
- Given an ER diagram, indicate what relations/tables should be
in the database, and what their attributes/columns should be.
- Given tables in a database (with tuples shown) and a relational
algebra query, indicate the resulting table.
- Given schemas of tables in a database (a description of which
attributes/columns they have) and a query given in English,
give an equivalent query in relational algebra.