A simple SQL compiler
- Type
- string
- integer
- Statement
- CREATE DATABASE
- DROP DATABASE
- SHOW DATABASES
- USE DATABASE
- CREATE TABLE
- DROP TABLE
- SHOW TABLES
- INSERT
- DELETE
- UODATE
- SELECT
Note:Currently only supports simple where syntax
- Python version: 3.x
- Python package:
- PLY(PLY (Python Lex-Yacc)):an implementation of lex and yacc parsing tools for Python
- PyMySQL:pure Python MySQL client
- Test database:MySQL
- Test data:testData.txt
- Configure database information line 296 in yacc.py
conn = pymysql.connect(host='127.0.0.1', user='root', passwd='mysql', db='mysql')
- Run
python yacc.py
- Select mode
- 1 Read data from testData.txt
- 2 Read data from terminal