Minirel2K: Utilities and Queries
EECS 484, Winter 2011
Project 4: Minirel 2K Query Processor
Due: April 13 at 10:30AM
In this project, you will implement a query processor and some basic utilities for the Minirel2K system.
When your query processor is complete, you will have a simple single-user DBMS that accepts a (small)
subset of SQL.
Once complete, your DBMS will include three executable programs, which you will be able to run from
the command line:
This executable creates the database
minirel <dbname> [SQL-file]
This executable allows you to interact with the database named
by writing (simple) SQL
If the optional
is specified, then the program reads SQL from that file.
While industrial-strength DBMSs support concurrent access to data, for the purposes of this
assignment, we will assume that there will be at most one minirel process running at a time, so we do
not need to worry about concurrency control.
This program deletes the database
To get your started, we provide a skeleton framework, which consists of a significant quantity of source
code, as well as some libraries.
Figure 1 gives an overview of the framework.
The following is a brief
description of each of the main components.
executable accepts SQL queries and other utility commands.
(See the next section
for a full description of the supported SQL commands.)
We provide a parser, which first parses the input
SQL, and then consults the system catalogs to make sure the commands are valid (i.e., the relations and
attributes mentioned by the command actually exist in the database.)
If the SQL is valid, the parser calls
the appropriate query operators and utilities.
The parser is implemented for you.
Query Optimizer, Operators, and Utilities:
This is where you will do most of your work.
incoming SQL command is valid, the parser calls the appropriate function to process the command:
If the command is a utility, the parser calls the appropriate function to process the utility.
this project, you will only be implementing one utility (insert).
The function header
(Updates::Insert) can be found in the file query.h, and the actual implementation of this function
will go in insert.cpp.
If the command is a query, the parser first determines if the query is a select query (referencing
just one table) or a join query.
To execute a select query, the parser calls Operators::Select (in
To execute a join query, it calls Operators::Join (in join.cpp).
The Operator class
definition can be found in query.h.
For this assignment, you will implement the insert, select, and join operators.