MiniRelDB is a lightweight relational database system implemented in C++. It supports core SQL-like operations such as CREATE, INSERT, SELECT, UPDATE, DELETE, and DROP. The system uses file-based persistence to simulate basic database functionality and is designed for educational purposes to understand how databases work under the hood.
- 🗃️ Create custom tables with columns and data types
- 📥 Insert rows into tables
- 🔍 Select rows with or without conditions
- ✏️ Update specific rows with
WHEREconditions - ❌ Delete rows with conditions
- 🧹 Drop entire tables
- 💾 Persistent storage using file I/O
- 🛠️ Easy to compile and run on Windows (MinGW) and Linux
MiniRelDB/
├── MiniRelDB.cpp # Main C++ source file
├── data/ # Folder for storing table files
└── README.md # Project documentation
- A C++ compiler (e.g. g++, MinGW for Windows)
- C++17 or later
# Windows (MinGW)
g++ -std=c++17 -Wall -Wextra -g MiniRelDB.cpp -o MiniRelDB.exe
# Linux
g++ -std=c++17 -Wall -Wextra -g MiniRelDB.cpp -o MiniRelDB# Windows
MiniRelDB.exe
# Linux
./MiniRelDBCREATE TABLE students (id INT, name STRING, marks INT);INSERT INTO students VALUES (1, "Alice", 85);SELECT * FROM students;SELECT * FROM students WHERE marks > 80;UPDATE students SET marks = 90 WHERE name = "Alice";DELETE FROM students WHERE id = 1;DROP TABLE students;- Each table is stored as a
.tablefile inside the/datadirectory. - Structure and content are saved in plain text format.
This project is ideal for:
- Learning how basic SQL commands work internally
- Understanding file-based data persistence
- Practicing data structures like vectors, maps, strings
- Language: C++17
- Storage: File I/O (no external libraries)
- IDE: Any C++ IDE or text editor (e.g. VS Code)
- Add support for
AND/ORconditions - Add primary key constraints
- Implement command history or scripting mode
- Improve error handling and validations
- Add GUI or web interface
This project is licensed under the MIT License.
Made with ❤️ by Aditya Kumar
Feel free to contribute, fork, and raise issues!
Let me know if you want it customized further — for example, including screenshots, test data examples, or setup instructions for Linux/Windows separately.