This is my solution for PA3 in Database Management System course
The file you are interested in is litedb.cpp.
I'd recommend CLion as your IDE for this repo.
Open folder litedb_c with CLion and it should automatically pick up the CMakeLists.txt and config the project. Then you can select one of the executables to run.
Unfortunately, it requires a specific collection of data (csv files) to run.
The program can be compiled like g++ -std=c++11 main.cpp
.
It is a very limited database management system. The specification is in PA3.pdf.
For short, It can read data from csv files which represent tables in a traditional DBMS, convert them into more computer-friendly format and store to disks. Then it can execute a subset of SQL, and output result to stdout.
-
Load CSV files
-
Read SQL from stdin (column store, no indexing)
-
Execute SQL
- Execute select/filter (things like A.c0 < 10) (push-down predicates)
- Optimize joins (Selinger's Algorithm, but no exactly correct)
- Execute joins (sorted nested loop join)
- Execute sums
NO, don't use it anywhere else. This repo is for educational purpose only.