Skip to content

Latest commit

 

History

History
98 lines (56 loc) · 1.09 KB

README.md

File metadata and controls

98 lines (56 loc) · 1.09 KB

MiniSQL

DataBase MiniSQL

编译环境

  • c++17 以上
  • GNU make

支持语法

  • 创建表

    create table student (
      sid char(8) unique ,                     //char(n)       1 <= n <= 255
      sname char(20) ,
      sage int ,
      scome float ,
      primary key (sid)
    );
    // 最多32个属性
  • 删除表

    drop table student;
  • 创建索引

    create index stuname on student(sname);
  • 删除索引

    drop index stuname on student;
  • 选择语句

    select * from	student;
    select * from student where sid = '88888888';
    select * from student where sage > 20 and scome < 2000;
    
    // < > <= >= <> = 
  • 插入语句

    insert into student values('88888888','xiaoming',20,2000.00);
  • 删除语句

    delete from student;
    delete from student where sid = '88888888';
  • 退出语句

    quit;
  • 执行脚本

    execfile test.txt;

要求

  • 返回查询时间、执行返回或影响的行数、错误信息

文件格式