A lightweight SQL engine built in Python that parses and executes simple SQL queries (SELECT, COUNT, WHERE) against CSV and CCOL (custom columnar format) data.
- SQL Parser (Step 2)
- Query Execution Engine (Step 3)
- Interactive CLI (Step 4)
- Unit Tests (Step 5)
- Benchmarks (Step 6)
- CCOL Writer/Reader (Step 7)
- Selective Reads (Step 8)
- String Offsets Optimization (Step 9)
Clone the repository and install dependencies:
git clone https://github.com/Jnaneswari19/sql-mini-engine.git
cd sql-mini-engine
pip install -r requirements.txtRun queries via CLI:
python -m sqlmini.cli "SELECT name, age FROM people WHERE age >= 30;"Run tests:
python -m pytestpython -m sqlmini.cli "SELECT COUNT(*) FROM sales;"
python -m sqlmini.cli "SELECT name FROM people WHERE age < 25;"
python -m sqlmini.cli "SELECT COUNT(age) FROM people WHERE age >= 30;"| Query | CSV (s) | CCOL (s) |
|---|---|---|
SELECT * FROM people; |
0.000133 | 0.000735 |
| Format | Time (s) |
|---|---|
| CSV selective read | 0.000147 |
| CCOL selective read | 0.000821 |
| Format | Read Time (s) | File Size (bytes) |
|---|---|---|
| Naive CCOL | 0.001012 | 186 |
| Offset CCOL | 0.002051 | 248 |
sql-mini-engine/
│ README.md
│ requirements.txt
│ LICENSE
│ .gitignore
│
├── data/
│ people.csv
│ people.ccol
│ people_naive.ccol
│ people_offsets.ccol
│ sales.csv
│
├── screenshots/
│ benchmarks.png
│ cli.png
│ tests.png
│ structure.png
│
├── sqlmini/
│ cli.py
│ engine.py
│ errors.py
│ parser.py
│ reader.py
│ writer.py
│ __init__.py
│
└── tests/
test_parser.py
test_engine.py
test_performance.py
test_ccol_bench.py
test_selective_read_bench.py
test_offsets_bench.py
- Parser implemented
- Engine implemented
- CLI implemented
- Tests passing
- Benchmarks documented
- CCOL Writer/Reader implemented
- Selective reads working
- String offsets optimization verified
- README polished with proof screenshots
- Installation section added
- Extra query examples added
- LICENSE file included
- Root
.gitignoreincluded
This project is licensed under the MIT License — see the LICENSE file for details.



