This project is a simple Database Management System (DBMS) implemented in Bash. It provides a basic interface for managing databases and tables using shell scripting, without relying on external database systems. The project demonstrates the core functionalities of a DBMS, including creating, listing, and removing databases and tables, as well as inserting data into tables with metadata constraints.
- Create Database: Allows users to create a new database.
- List Databases: Displays all existing databases.
- Connect to Database: Navigates into a selected database for table operations.
- Drop Database: Deletes an existing database with confirmation.
- Create Table: Allows the creation of tables with column definitions and constraints.
- List Tables: Displays all tables within the connected database.
- Remove Table: Deletes a specific table with user confirmation.
- Insert into Table: Inserts rows into a table while ensuring compliance with column definitions and constraints.
- Metadata Management: Each table has:
- A data file that stores column names and data rows.
- A metadata file that holds information about column definitions and constraints.
-
Clone the repository:
git clone https://github.com/nada19885/DBMS-ITI.git cd bash-database-management-system
-
Run the script:
./database_manager.sh
-
Follow the menu options to:
- Create and manage databases.
- Define tables with column types and constraints.
- Insert and manage data within tables.
-
Create a Database:
- Choose the "Create Database" option and specify the database name.
-
Connect to the Database:
- Select "Connect to Database" and choose the database to manage.
-
Create a Table:
- Define table columns in the format
column_name(type)[constraint]
(e.g.,id(int) PK
).
- Define table columns in the format
-
Insert Data:
- Input values for each column following the defined structure.
-
Manage Tables:
- List or remove tables as needed.
- Supports basic column types:
int
,string
. - Allows constraints like
PK
(Primary Key) andNOT NULL
. - Ensures data integrity by validating input against column definitions.
- Add support for more data types and constraints (e.g.,
DEFAULT
,UNIQUE
). - Implement advanced query operations like filtering and sorting.
- Introduce better error handling and logging.