Carnegie Mellon University
15721 Database System Design and Implementation
Spring 2003 - C. Faloutsos
Homework 1 - Due: 3/4

0) Reminders:

0.1) Time estimates

1) Q1: SQL [10 pts]

Consider the file  peer-oregon+010526.txt.gz  which has information about the internet routers. Specifically, it has pairs of nodes, blank separated, one per line. The pair, eg.,
10 12
means that node '10' has an outgoing link to node '12'. Load this file in a DBMS (eg., MSAccess on the clusters) and answer the following query:

QUERY: for each node, list the node-id and the  count of out-going edges, sorted in decreasing count order

No extra credit: FYI, there is a large repository of Internet datasets at

2) Q2: Z-ordering and B-trees [90pts]

Obtain  B-tree code from any source you would like (suggested: btree721_S03.tar.gz )  and build a z-ordering method on top of it. Your final system  (say, with the executable called 'zorder') should be able to handle the  commands 'c'lear, 'i'nsert, 'r'ange-search, e'x'it. Sample usage scenario ('%' is the UNIX prompt, 'z>' is the prompt of your zorder system, and bold font stands for user input)

% zorder
z> c                         # should clear the B-tree
z> i 10 20  pitt             # should inser the point (10,20), and label it "pitt"
z> r 0 100 0 200             # should return all the points in the range 0<=x<= 100 ; 0<= y <= 200
        10 20 pitt
z> x                         # exit

2.1) Assumptions you may make:

2.2) Important specifications:

2.3) What to hand in

  1. [70pts] Hard copy of ALL your source code - mark the routines related to the z-order: range-searchpoint-insert, etc.
  2. [20pts] Hard copy of the output of your code on the test scripts that we will announce later.
  3. [0pts] e-mail a tar-ball with a 'makefile' to the instructor - 'make demo' should compile your program and run it on the test scripts above.

Last modified by Christos Faloutsos, 2/2/2003