Git Product home page Git Product logo

sql-engine's Introduction

About

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

Requirements

  • Python 2.7
  • SQL Parse (pip install sqlparse)
  • Pretty Table (pip install prettytable)

Files

  • mini_sql.py: Main File
  • sample_data: It contains two sample data inside folders A and B for testing purpose.
  • instructions.md: Instructions to run sql query
  • metadata.txt: Contains metadata: table and column names
  • table1.csv: It contains data of table named "table1"

NOTE:

  1. Column name should not start with number but can contain a table name.
  2. The case of the DML language (query) does not matter.
  3. 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.
  4. In case of multiple AND/OR, the conditions must be properly enclosed within ().

sql-engine's People

Contributors

priyansh2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.