This repository contains the codebase of my DBMS project named Mini SQL Engine.
Mini SQL Engine is written in Python and can parse and execute a subset of DML queries given using the command-line interface on data stored as CSV files. Please Read problem_description.pdf for more details.
Following cases of query processing are handled as of now.
- Blank column entries while entering data
- Single and double quoted values in CSV files
- Multiple AND/OR queries, including nested ones
- Operators handled in column comparison:
=, !=, >, <, <=, >= - Aggregate functions:
distinct, sum, min, max, avg. - Pretty Table output
- Summary of successful query
- Table aliasing
- Python 2.7
- SQL Parse (
pip install sqlparse) - Pretty Table (
pip install prettytable)
mini_sql.py: Main Filesample_data: It contains two sample data inside foldersAandBfor testing purpose.instructions.md: Instructions to run sql querymetadata.txt: Contains metadata: table and column namestable1.csv: It contains data of table named "table1"
- Column name should not start with number but can contain a table name.
- The case of the DML language (query) does not matter.
- When selection from multiple tables is made, the user will expect to give an equijoin condition; otherwise, it would perform cross-join and output the result accordingly.
- In case of multiple AND/OR, the conditions must be properly enclosed within
().