MINIPROJECT

Click here for an audio lecture that can be played using RealPlayer
Click here for audio-text lecture and feed it to the speech agent

The miniproject is 10 points plus 3 extra bonus points for early submission, and 3 extra bonus points for completion of optional part.

Select one project from the projects described below. You may not design your own project. You may not select more than one project.

If you are a graduate student, you are also required to turn in a project report and give a five-minute project presentation and a live demo. If you are an undergraduate student, you are required to turn in a single-page readme file and give a live demo, but not required to turn in a project report.

Project 1: SQL Compiler

Implement the SQL compiler discussed in part (ii) of Exercise 3. You may use any compilable programming language in the implementation, except PERL, PYTHON and other interpretive languages. Although PERL program can be compiled it will still be disallowed. When you are ready to turn in the project, bring your diskette containing source, executable and test data, so that you can give the instructor a live demo. The miniproject is to implement the SQL Compiler to translate simplified SQL queries into relational algebraic queries. The simplified SQL queries are of the following form: Optional Part P2: 3 bonus points if you also implement the relational operators Project, Select and Join, so that your program is a complete system to translate and execute simplified SQL queries. (If you can only implement project and select, you will still get some bonus points!)

Files on Diskette: There should be the following files on the diskette you turn in: (Obviously, you can have Q3, Q4, ..., etc. You should prepare a mixture of queries, starting from simple ones, then to more complex ones, plus queries containing syntactic errors or semantic errors.)

For the optional part P2, there should be the following files: The database definition (DBD) file may look like this: The input data file (INDATA) may look like this:
Translated queries can either be stored in files T1, T2, etc. or displayed on the screen. Final output should be displayed on the screen.

Test your program on the following examples: The translated relational algebraic query T1 may look like:
It is important to understand that the relational algebra is a procedural language. Therefore you should generate one command line for each relational algebraic operator. If you just use simple pattern matching then you will not be able to distinguish restrict and join operators. Your program will not work correctly and you may lose 3 or more points!

The results to execute a query may look like:

Grading

6 for successfully doing P1 to translate queries (correctness)
1 capability to handle different DBD (0.5) and join queries (0.5) (generality)
1 capability to detect syntactic errors (0.5) and semantic errors (0.5) in input queries (error handling)
2 quality of programming (0.5), comments in source codes (0.5), display format (0.5), user's manual (0.5) (quality)
3 bonus points for doing P2 to execute queries
3 bonus points for early submission