Giter Club home page Giter Club logo

awwwesome-minisql's Introduction

Install Guide安装向导

Requirements

  • ncurses library
  • readline library (for linux)
  • gcc 4.9+

Prepare, Download, Compile and Run

We need to install gcc-4.9 and readline to make our program.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y ncurses-dev libreadline6-dev gcc-4.9
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc -f
curl -o Awwwesome-MiniSQL.zip  https://codeload.github.com/Awwwesome-MiniSQL/Awwwesome-MiniSQL/zip/master
unzip Awwwesome-MiniSQL.zip
cd Awwwesome-MiniSQL
make
./MiniSQL

In MiniSQL, you can type:

exec Data/table-create-drop-0.sql;
exec Data/table-create-drop-1.sql;
exec Data/table-create-drop-2.sql;
exec Data/table-insert-delete-0.sql;
exec Data/table-insert-delete-1.sql;
exec Data/table-select-0.sql;
exec Data/table-select-1.sql;
exec Data/test-1000.sql;
exec Data/test-1w.sql;
exec Data/test-10w.sql;
select * from person where age = 380;
quit

MiniSQL

This MiniSQL project is maintained by Stephen Tse, chenyuan and Yangguang.Zhang.

Overview

MiniSQL supports the following data types for an attribute:

  • int
  • float
  • char(n), 1 <= n <= 255

MiniSQL supports the following standard SQL statements. Note that all SQL statements should END WITH ; and key words should be lowercase.

  • create / drop table
create table tableName (attrA int, attrB float unique, attrC char(20), primary key(attrX));
drop table tableName;
  • create / drop index
create index indexName on tableName(attrName);
drop index indexName;
  • select
select attrA, attrB from tableName where attrC = X;
select * from tableName;
  • insert
insert into tableName values (valueA, valueB, valueC);
  • delete
delete from tableName where attrA >= X and attrB < Y;
  • quit

  • import SQL file

exec fileName.sql

Detailed Specification

MiniSQL consists of seven components:

  • Interpreter Interpret SQL statements, invoke API and return results.

  • API Provide APIs that execute SQL statements, connect Interpreter with other components.

  • Record Manager Create / delete files, insert / delete / select tuples.

  • Index Manager Create / delete B+ trees, insert / delete / select keys.

  • Catalog Manager Access and manipulate meta-data of tables, attributes and indexes.

  • Buffer Manager Read / write blocks, buffer replacement, record status and locks.

  • DB Files Catalog / data / index files.

awwwesome-minisql's People

Contributors

save4safe avatar xjiajiahao avatar zjuchenyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zjuchenyuan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.