Skip to content

Sameerakhatoon/sql-rdbms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 

Repository files navigation

SQL-RDBMS โ€” Lightweight Relational Database Engine in C

๐Ÿ“Œ Overview

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

๐Ÿ› ๏ธ Tech Stack

  • Language: C
  • Indexing: B+ Trees
  • Platform: Linux (CLI-based execution)

โš™๏ธ Key Features

  • ๐Ÿ—‚๏ธ 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.


๐Ÿงช Supported SQL Operations

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

๐Ÿš€ Building and Running

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
./rdbms

You can now execute SQL commands in the CLI shell.


๐ŸŽฏ Future Improvements

  • Query optimization strategies
  • Persistent storage via file-backed pages
  • Transaction support (ACID compliance)
  • Support for secondary indexes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published