Purpose: Development of a Database engine based on relational model that implements its own database storage format and supports  SQL statements.

Database Engine based on Relational Model

This document is intended to be used by the members of the project team that will implement and verify the correct functioning of the system. 

Overview: The Database engine will be developed in Java.The Engine has a Command interpreter interface for the user All SQL statements are entered via a command interpreter.

Database management systems have emerge as a fairly standard part of any company back office. Typical examples of DBMS include accounting, human   resource, customer support system etc. 

So, we developed an application to manage a database that supports the rules of relational model in DBMS. This motivated us to develop lightweight , easy to use  application for database management. 

 Problem Statement 

A lot of database engines are available in the market like ORACLE, MySQL,Sybase, IBM DB2 and many more. 

We decided to develop a lightweight, easy to use application in comparison to these heavy applications.It provides user a platform to execute simple SQL queries on command prompt and determine RELATIONAL ALGEBRA conversion of its SQL queries. 

For this, we first need to have a parser that will check and validate the grammar of query and verifies the fields and expressions defined in the query. Then we need to process these these tokens and project our result on command prompt.

Zql Parser:

We have used Zql parser to validate the syntax of SQL queries .

It will first determine the operation like SELECT, INSERT , UPDATE and then it will update the syntax of each of the queries with following methods. 

1. ZInsert for INSERT query syntax.

2. ZDelete for DELETE query syntax.

3. ZUpdate for UPDATE query syntax.

4. ZQuery for SELECT query syntax. 

ZExpression.java  and  ZEval.java  will validate the syntax of the expressions that are to be evaluated and verifies whether the fields and tables are present or not.

Tokenization and processing of Query:

After validating the grammar and fields, ZInsert , ZDelete , ZUpdate , ZQuery  will  produce the tokens that are to evaluated. 

These tokens are passes to ZExec.java which will process these tokens as per query requirements.

AddClient is called within the ZExec module which will project the RELATIONAL ALGEBRA conversion of the SQL query. 

Representation of data at Physical level:

Database at physical level is represented in database files with   ‘.db’ extension.

We have used contact.db , num.db , employee.db and many more database files to process SQL queries for our application.


Here we represent the flow of data in our application.

Data Flow Diagram , Process flow diagrams and State flow are used to describe the approaches used in developing application.

Download Database Engine based on Relational Model Project in Java Project Source code, report, design details.