This project aims to develop a simple Database Management System (DBMS) using Bash shell scripting. The system allows users to store and retrieve data from the hard disk through a Command-Line Interface (CLI) menu-based application.
- Create Database: Create a new database (stored as a directory).
- List Databases: List all existing databases.
- Connect To Database: Connect to a specific database to perform operations.
- Drop Database: Delete a specified database.
- Create Table: Create a new table within the connected database.
- List Tables: List all tables within the connected database.
- Drop Table: Delete a specified table from the connected database.
- Insert into Table: Insert a new row of data into a specified table.
- Select From Table: Retrieve and display data from a specified table.
- Delete From Table: Delete specific rows from a specified table.
- Update Table: Update data in a specified table.
-
Create Database
- Enter the database name.
- The system will create a directory for the database if it does not already exist.
-
List Databases
- Lists all existing databases (directories).
-
Connect To Database
- Enter the database name to connect.
- Upon successful connection, a new menu for database operations is displayed.
-
Drop Database
- Enter the database name to delete.
- The system will prompt for confirmation before deleting the database.
-
Create Table
- Enter the table name and the number of columns.
- Define column names and data types (int or str).
- The first column is the primary key (int).
-
List Tables
- Lists all tables (files) in the connected database.
-
Drop Table
- Enter the table name to delete.
- The system will prompt for confirmation before deleting the table.
-
Insert into Table
- Enter the table name.
- Input values for each column. The system validates data types and enforces primary key uniqueness.
-
Select From Table
- Choose to display the entire table or specific rows based on column values.
-
Delete From Table
- Enter the table name and row number to delete.
- The system will prompt for confirmation before deleting the row.
-
Update Table
- Enter the table name and primary key value of the row to update.
- Input new values for the columns. The system validates data types.
- Databases are stored as directories in the current script directory.
- Tables are stored as files with the
.tableextension. - Metadata files (e.g.,
metaData_<table_name>) store schema information for each table. - Primary key constraints and data type checks are enforced during data insertion and updates.
- Log files track operations like deletions for auditing purposes.
- Ensure you have Git installed on your system.
- Open a terminal and navigate to the directory where you want to clone the repository.
- Run the following command:
git clone <https://github.com/ibrahimsaber1/DBMS-BASH-SCRIPT-ITI.git>
- Navigate to the project directory:
cd <DBMS-BASH-SCRIPT-ITI>
- Ensure you have Bash installed on your system.
- Make the main script executable:
chmod +x main.sh
- Run the script:
./main.sh
- main.sh: The main script that displays the main menu and handles user input for database operations.
- createDatabase.sh: Script to handle the creation of databases.
- listDatabase.sh: Script to list all existing databases.
- connectToDatabase.sh: Script to connect to a specific database and display the database operations menu.
- dropDatabase.sh: Script to delete a specified database.
- createTable.sh: Script to handle the creation of tables within a connected database.
- listTable.sh: Script to list all tables within a connected database.
- dropTable.sh: Script to delete a specified table from a connected database.
- insertIntoTable.sh: Script to insert data into a specified table.
- selectFromTable.sh: Script to retrieve and display data from a specified table.
- deleteFromTable.sh: Script to delete specific rows from a specified table.
- updateTable.sh: Script to update data in a specified table.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
This project was made by two ITI students:
- Ibrahim Saber
- David Emad