A lightweight SQL-compliant relational database engine built from scratch in C. Inspired by core RDBMS concepts and compiler design techniques, this project implements key features such as SQL parsing, indexing, query planning, and execution. The system supports a subset of SQL including:
SELECT,JOIN,WHERE,GROUP BY,ORDER BY- DDL statements like
CREATE TABLE - DML operations like
INSERT,UPDATE,DELETE
- Language: C
- Indexing: B+ Trees
- Platform: Linux (CLI-based execution)
-
๐๏ธ SQL Query Support Implements core SQL functionalities including joins, projections, filters, and aggregates.
-
๐ ๏ธ Custom SQL Parser Reuses a hand-written lexer and parser (developed in a prior compiler project) to tokenize and parse SQL queries into abstract syntax trees.
-
๐ณ B+ Tree Indexing Enables fast data lookups and efficient range scans using a self-implemented B+ Tree data structure.
-
๐ Schema & Catalog Management Maintains metadata using schema and catalog tables to support query planning and execution.
-
๐งฎ Expression Tree Evaluation Executes filter conditions, projection logic, and aggregate functions using recursive expression trees.
| Category | Features |
|---|---|
| DDL | CREATE TABLE, DROP TABLE |
| DML | INSERT, DELETE, UPDATE |
| SELECT | WHERE, JOIN, GROUP BY, ORDER BY, aggregate functions (SUM, COUNT, etc.) |
| Indexing | B+ Tree-backed primary key support |
| Metadata | Internal system tables for managing catalog and schema |
Requires GCC and Linux-compatible environment.
# Clone the repo
git clone https://github.com/your-username/SQL-RDBMS.git
cd SQL-RDBMS
# Compile
make
# Run the CLI shell
./rdbmsYou can now execute SQL commands in the CLI shell.
- Query optimization strategies
- Persistent storage via file-backed pages
- Transaction support (ACID compliance)
- Support for secondary indexes