This repository contains projects and exercises related to Database Management Systems (DBMS).
It includes both practical code implementations in Python + MySQL and theoretical database design exercises (ER modeling, relational algebra, normalization).
A Python-based project that creates and queries a database of planets and species (inspired by Star Wars).
It demonstrates how to combine Python, SQL, and CSV data into an interactive command-line application.
Files:
db_setup.py
→ Creates the databasehabeb
, tables (species
,planets
), and imports data from CSVs.db_cli.py
→ Provides a CLI menu for querying the database (list planets, search species, find climate, etc.).species.csv
/planets.csv
→ Dataset files (placeholders with headers if missing).
Features (CLI Menu):
- List all planets
- Search planet details by name
- Find species taller than a given height
- Discover the most likely desired climate of a species
- Show average lifespan per species classification
- Exit
A collection of theoretical DBMS problems and solutions, including:
- Entity-Relationship (ER) modeling
- Relationship types (one-to-one, one-to-many, many-to-many)
- Relational algebra queries
- Functional dependencies (FDs)
- Keys and normalization (3NF vs BCNF)
- Schema decomposition
File:
database-design-exercises.pdf
- Python 3.x
- MySQL Server
- MySQL Connector for Python
Install dependencies:
pip install mysql-connector-python
-
Start MySQL server and ensure credentials match:
- user:
root
- password:
root
- host:
127.0.0.1
- user:
-
Run the CLI program:
python db_cli.py
The program will create the database if not already present and load data from CSV files.
These projects were created to:
- Practice database creation, schema design, and normalization.
- Explore SQL queries, joins, and aggregation.
- Learn how to integrate Python with MySQL for database applications.
- Strengthen both theoretical DBMS concepts and practical implementation.
This repository is licensed under the MIT License.
Mustafa Habeb
Fresh Software Engineer passionate about databases, backend systems, and software engineering.