https://github.com/satyammittal/mini-sql-engine
a mini sql engine which will run a subset of SQL Queries using command line interface .
https://github.com/satyammittal/mini-sql-engine
database-system mini-sql-engine sql-query
Last synced: 11 months ago
JSON representation
a mini sql engine which will run a subset of SQL Queries using command line interface .
- Host: GitHub
- URL: https://github.com/satyammittal/mini-sql-engine
- Owner: satyammittal
- Created: 2018-01-28T21:44:11.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-03T11:59:06.000Z (about 7 years ago)
- Last Synced: 2025-02-12T01:54:49.200Z (about 1 year ago)
- Topics: database-system, mini-sql-engine, sql-query
- Language: Python
- Size: 107 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MINI-SQL-ENGINE
#### Description
a mini sql engine which will run a subset of SQL Queries using command line interface .
Type of Queries implemented here:
Select all records : Select * from table_name;
Aggregate functions: Simple aggregate functions on a single column. Sum, average, max and min. They will be very trivial given that the data is only numbers: select max(col1) from table1;
Project Columns(could be any number of columns) from one or more tables : Select col1, col2 from table_name;
Select/project with distinct from one table : select distinct(col1), distinct(col2) from table_name;
Select with where from one or more tables: select col1,col2 from table1,table2 where col1 = 10 AND col2 = 20; a. In the where queries, there would be a maximum of one AND/OR operator with no NOT operators.
Projection of one or more(including all the columns) from two tables with one join condition :
a. select * from table1, table2 where table1.col1=table2.col2; b. select col1,col2 from table1,table2 where table1.col1=table2.col2;
#### Credits
#### [moz_sql_parser]: https://github.com/mozilla/moz-sql-parser
## How to Run
`python main.py "{query}"`
example: `python main.py "select * from table1;"`