Download, Build and Play with Bruinbase

Download and unzip bruinbase.zip in the ${HOME}/bruinbase directory of your VM. Build the Bruinbase executable by running "make" in the bruinbase directory:
$ unzip -d ~/bruinbase bruinbase.zip
$ cd ~/bruinbase
$ make
make will build the bruinbase executable file, bruinbase, in the current directory. Make sure that it has been built successfully:
$ ls -l bruinbase
-rwxrwxr-x  1 cs143 cs143 529929 2008-03-30 03:27 bruinbase
Now run "bruinbase" to enter its command line interface:

$ ./bruinbase
Bruinbase>
Once you are inside Bruinbase, you can interact with it by issuing SELECT, LOAD, and QUIT commands. All tables in Bruinbase have two columns, key (integer) and value (string of length up to 99). For example, the Movie table that has been preloaded to Bruinbase can be queried as follows:

Bruinbase> select * from movie where key > 1000 and key < 1010
1008 'Death Machine'
1002 'Deadly Voyage'
1004 'Dear God'
1003 'Deal of a Lifetime'
1009 'Death to Smoochy'
  -- 0.162 seconds to run the select command. Read 403 pages

Bruinbase> select count(*) from movie
3616
  -- 0.160 seconds to run the select command. Read 403 pages

Bruinbase> select * from movie where key=3421
3421 'Remember the Titans'
  -- 0.162 seconds to run the select command. Read 403 pages

Bruinbase> select * from movie where value='Die Another Day'
1074 'Die Another Day'
  -- 0.162 seconds to run the select command. Read 403 pages

Bruinbase> 
Note that the first column of the table is an integer column with the name key and the second column is a string column with the name value.

As in the above example, Bruinbase supports simple SELECT statements. You can list only one table name in the FROM clause. You can have one of:

in the SELECT clause. You can list multiple conditions in the WHERE clause, but all conditions should be ANDed together. OR is not supported. All basic comparison operators (<, <=, >, >=, =, <>) can be used as part of the conditions. The table and column names are case insensitive, so movie and MOVIE refer to the same table.

Run a few other SELECT commands to get yourself familiar with Bruinbase. Once you are done, you can issue the QUIT command to exit.

Bruinbase> quit
Note that the LOAD command has not been implemented in the provided code and will need to be implemented as part of this project.

Notes on make: make is a development tool that helps you build the target executable from source files. It requires the input configuration file, named Makefile, that specifies the sources files and the tools needed to build the target executable. Since we have already included the basic Makefile in bruinbase.zip, you won't probably have to write one yourself. Whenever make is executed, it checks whether any source file has changed and rebuilds the target if there has been any change. As you modify the Bruinbase code, you will have to run the make command repeatedly to rebuild bruinbase and test your implementation. Even though you do not need to know how make works, if you are interested, please read the Make tutorial.