NITCBase is a mini DataBase Management System developed as part of a university laboratory course. It is a lightweight database system designed for educational purposes, allowing users to perform basic database operations. This README file provides essential information for setting up and running NITCBase.
- Prerequisites
- Getting Started
- Installation
- Running NITCBase
- Usage
- XFS-Documentation
- Contributing
- License
Before running NITCBase, ensure that you have the following prerequisites installed on your system:
- Linux-based operating system (tested on Ubuntu)
- C/C++ compiler (gcc/g++)
- Git
Follow these steps to set up and run NITCBase on your system:
-
Clone the NITCBase repository to your local machine:
git clone https://github.com/jagadee23/nitcbase
-
Navigate to the project directory:
cd nitcbase/mynitcbase
-
Build the NITCBase application using the make command:
make
-
In case you run into any issues while creating builds, install the necessary packages.
Once you have successfully built NITCBase, you can run it with the following command:
./nitcbase
NITCBase provides a simple command-line interface for executing basic database operations. You can interact with the database using various SQL commands. For detailed information on available commands and their usage, refer to the XFS-Documentation provided at the link.
For detailed information on architecture, methodology, design, and roadmap, please refer to the NITCBase Documentation.
The Front End parses SQL-Like queries and converts them into a sequence of algebra layer and schema layer method calls. The algebra layer functions process the basic insert and retrieval requests to and from the database. Retrieval functions will create a target relation into which the retrieved data will be stored.
For all functions, output will be similar to this in the algebra layer:
SUCCESS
: On successful insert of the given record into the relationE_RELNOTOPEN
: If the relation is not openE_NATTRMISMATCH
: If the actual number of attributes in the relation is different from the provided number of attributesE_ATTRTYPEMISMATCH
: If the actual type of the attribute in the relation is different from the type of the provided attribute in the recordE_DISKFULL
: If disk space is not sufficient for inserting the record / indexE_NOTPERMITTED
: IfrelName
is eitherRELATIONCAT
orATTRIBUTECAT
(i.e., when the user tries to insert a record into any of the catalogs)
-
Insert
int insert(char relName[ATTR_SIZE], int numberOfAttributes, char record[][ATTR_SIZE]);
-
Project Specified Attributes
int project(char srcRel[ATTR_SIZE], char targetRel[ATTR_SIZE], int tar_nAttrs, char tar_Attrs[][ATTR_SIZE]);
-
Project All Attributes (Copy Relation)
int project(char srcRel[ATTR_SIZE], char targetRel[ATTR_SIZE]);
-
Select
int select(char srcRel[ATTR_SIZE], char targetRel[ATTR_SIZE], char attr[ATTR_SIZE], int op, char strVal[ATTR_SIZE]);
-
Join
int join(char srcRelOne[ATTR_SIZE], char srcRelTwo[ATTR_SIZE], char targetRel[ATTR_SIZE], char attrOne[ATTR_SIZE], char attrTwo[ATTR_SIZE]);
The Block Access layer processes the requests for update/retrieval from the algebra and schema layers and works with disk blocks that are buffered by the Buffer layer.
-
linearSearch
RecId linearSearch(int relId, char *attrName, Attribute attrVal, int op);
-
search
int search(int relId, Attribute *record, char *attrName, Attribute attrVal, int op);
-
insert
int insert(int relId, union Attribute *record);
-
renameRelation
int renameRelation(char *oldName, char *newName);
-
renameAttribute
int renameAttribute(char *relName, char *oldName, char *newName);
-
deleteRelation
int deleteRelation(char *relName);
-
project
int project(int relId, Attribute *record);
The B+ Tree Layer provides indexing functionality for attributes.
-
bPlusCreate
int bPlusCreate(int relId, char attrName[ATTR_SIZE]);
-
bPlusSearch
RecId bPlusSearch(int relId, char attrName[ATTR_SIZE], union Attribute attrVal, int op);
-
bPlusDestroy
int bPlusDestroy(int rootBlockNum);
-
bPlusInsert
int bPlusInsert(int relId, char attrName[ATTR_SIZE], union Attribute attrVal, RecId recordId);
-
findLeafToInsert
int findLeafToInsert(int rootBlock, Attribute attrVal, int attrType);
-
insertIntoLeaf
int insertIntoLeaf(int relId, char attrName[ATTR_SIZE], int blockNum, Index entry);
-
splitLeaf
int splitLeaf(int leafBlockNum, Index indices[]);
-
insertIntoInternal
int insertIntoInternal(int relId, char attrName[ATTR_SIZE], int blockNum, Index entry);
-
splitInternal
int splitInternal(int intBlockNum, InternalEntry internalEntries[]);
-
createNewRoot
int createNewRoot(int relId, char attrName[ATTR_SIZE], Attribute attrVal, int lChild, int rChild);
We welcome contributions to NITCBase! If you would like to contribute to this project, please create a pull request and make sure to follow decent naming conventions. Upon review, your request will be merged if found useful.
NITCBase is licensed under the MIT License.
Thank you for using NITCBase. If you encounter any issues or have questions, please don't hesitate to create an issue on our GitHub repository.