SDB

# SDB: A Simple Relational Database Management System

The source files for the SQL DBMS, called SDB (which stands for a Simple Database System), are the following:

1. `main.cc`: The main program.
2. `sql.y`: The yacc grammar for the sql syntax.
3. `sql.lex`: The lex scanner to parse tokens.
4. `~fegaras/cse6331/optgen/basic.h`: The `Expr` class, the list templates, etc; READ IT.
5. `typecheck.h/.gen`: This is the typechecking program.
6. `optimizer.h/.gen`: This is the actual optimizer. READ `optimizer.gen`.
7. `evaluation.h/.gen`: This is the in-memory evaluator; READ `evaluation.h`.
8. `common.cc`: it is included in `optimizer`; it contains code for memoization and tracing; don't mess with it.
9. `company.sql`: The company schema and data as they are described in Elmasri's book.
10. `queries.sql`: A sample of few queries against the company database.
11. `database`: The actual database state.

All `.gen` files need to be compiled by the `optgen` program located at `~fegaras/cse6331/optgen/`. This is done automatically during Make.

At this point, SDB compiles, optimizes, and executes (in memory) all SQL queries with simple predicates, unions, grouping, and aggregations.