An experimental attempt at creating a simple, standalone, serverless Database Management System with an ultimate goal of learning the internals. Supports simple, basic queries. SQL statements have the same syntax as MySQL's. Runs only on linux machines.
- It can be installed by running the install.sh shell script (or)
- cmake . & make install
The executable binary will be installed inside OurSQL/bin
The executable takes only a data-directory location as a command line argument, which also is optional. By default, OurSQL creates a data directory in the current working directory.
The following queries are supported in OurSQL. All SQL commands are case insensitive.
- CREATE DATABASE dbname;
- SHOW DATABASES;
- USE dbname;
- CLOSE DATABASE;
- DROP DATABASE dbname;
- CREATE TABLE tblname (col1 col1-type[(col1-width)] [, col2 col2-type[(col2-width)] ,...]);
- INSERT INTO tblname [(col1, col2,...)] VALUES (val1[, val2 ,...]);
- SELECT *|col1[,col2 ,...] FROM tblname [WHERE cond];
- UPDATE tblname SET col=val [WHERE cond];
- DELETE FROM tblname [WHERE cond];
- SHOW TABLES;
- SHOW COLUMNS FROM tblname;
- ALTER TABLE tblname RENAME TO new-tbl-name;
- ALTER TABLE tblname RENAME COLUMN col-name TO new-col-name;
- ALTER TABLE tblname ADD COLUMN new-col new-coltype;
- ALTER TABLE tblname DROP COLUMN col-name;
- DROP TABLE tblname;
- IMPORT FROM complete-sql-file-path;