This Bash script provides a simple command-line interface for managing databases and tables. It allows users to create, list, delete databases, create tables, and perform various operations on tables within databases.
This script provides a menu-driven interface that allows users to perform the following actions:
- Create a new database.
- List existing databases.
- Connect to a specific database and perform operations on tables.
- Delete a database.
- Database creation and deletion.
- Table creation, deletion, and manipulation.
- User-friendly menu-driven interface.
- Input validation for data integrity.
- Bash (Bourne Again SHell) should be installed on your system.
-
Clone the repository:
git clone https://github.com/MahmoudDabbous/bashdb cd bashdb
-
Run the script:
./dbms.sh
-
Follow the on-screen instructions to navigate through the menu and perform actions.
./dbms.sh
1. Create DB
2. List DB
3. Connect to specific DB
4. Delete DB
5. Exit
Enter your choice: 1
Name of the database: mydatabase
Enter your choice: 3
Choose database to connect to: mydatabase
1. Create Table
2. List Tables
3. Drop Table
4. Insert into table
5. Select from table
6. Delete from table
7. Update table
8. Exit
Enter your choice: 1
Name of the table: mytable
Enter columns names and types (one line per column)
> id:Number
> name:Text
type "exit" when you finish entering columns
> exit
Set the primary key (enter colName)
> id
Primary key set to id
mytable created successfully.
Enter your choice: 4
Enter table name: mytable
Enter values for id name (separated by spaces):
1 Mahmoud
Data inserted successfully.