DFC Query Builder is a mini scale database management system. Originally planned as a SQL query builder, the project evolved into something more.
This project was done as a part of Database Systems course in Vth semester B.Tech program in Department of Information Technology, National Institute of Technology Karnataka, Surathkal during the academic year 2014.
Queries works exactly like real-life database management systems MySQL. As of now following queries are supported :
- CREATE Table
- SHOW Tables
- DESCRIBE Table
- DROP Table
- INSERT INTO Table
- SELECT Table
We have provided a simple web-based GUI for the user to input the query. The user just have to make a few clicks and enter only the relevant part of the query. Our system generates an equivalent SQL query for the requested operation. Users can also view the SQL Query being executed.
Our Database Management System is implemented using C++ which receives messages from the front-end Web Server (Coded using PHP) using Sockets. This C++ program acts as a live database server which listens for query and returns the result. It stores the data on physical disk using files. The main highlights of our backend are as follows :
- Custom Blocks for each Table – It is always a multiple of record size. This saves space as well as overhead of checking for waste space. Our system reads data from and writes data to disk in blocks.
- B+ Tree Indexing – A separate multilevel B+ Tree for each table. Each node of the B+ Tree contains around 30 entries. It is used to index primary key. Right now the system supports only primary key indexing and all data type for primary key should be an integer. The Indexing reduces the time complexity of searching for a record.
- Storing Meta Data of tables – Meta Data of the tables are stored separately which provides quick access to several information like current number of records, table name, B+ tree indexing dat, etc.
- Temporary Tables – We use temporary table to store intermediate results obtained from any query. However, user generated temporary table is currently not supported. The system applies the conditions specified in SELECT Query's WHERE clause incrementally one by one.
- Operators - 6 relational operators namely - (>=, <=, >, <, =, !=) and one Logical Operator – (AND) is currently supported by our system.
- Brute Search and B+ Tree Indexed Search - Both methods implemented to search for a record in the file. Brute Force is used in cases where the primary key indexing cannot be used to fetch record.
Pre-requisites : Linux, A C++ Compiler, A Web Server (Apache)
Getting Started:
- User has to host the Web_Server Folder and access the "index.php" file.
- User has to compile the "main.cpp" program in the Core folder using any standard C++ compiler (G++ is recommended).
- After compiling the program the user should execute the program passing the desired port number as a command line argument on which the server should run.
- Once the server starts running, the same port number and the system's IP address can be entered in the Login Screen of PHP. The user and password both are hard-coded at "root".
- Once Logged in, the user can execute the queries as listed on the side-pane.
- Users can monitor the working of DBMS core on the terminal.
The following members contributed equally to this project :
- Adarsh Mohata - amohta163@gmail.com - Git : https://github.com/Adarsh1994
- Ajith P S - ajithpandel@gmail.com - Git : https://github.com/ajithps
- Ashish Kedia - ashish1294@gmail.com - Git : https://github.com/ashish1294
~ a.k.a Team Bug Assassins