Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 973 Bytes

README.md

File metadata and controls

50 lines (43 loc) · 973 Bytes

SQLCompiler

A simple SQL compiler


Already implemented

  • 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


How to run?

  • Python version: 3.x
  • Python package:
  • 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