https://github.com/oleksiym/06-web-hw
https://github.com/oleksiym/06-web-hw
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/oleksiym/06-web-hw
- Owner: OleksiyM
- License: mit
- Created: 2023-12-28T16:21:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-11T11:14:28.000Z (over 1 year ago)
- Last Synced: 2024-02-11T22:34:54.302Z (over 1 year ago)
- Language: Python
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Database Management Tool
This Python application manages a SQLite database containing student, professor, subject, and grade data for a school. It provides functions to create, populate, query, and interact with the database.
## Features
- **Database creation and table management:**
- Creates SQLite database file `db.sqlite3` with the following tables:
- `groups`
- `students`
- `professors`
- `subjects`
- `grades`
- Establishes appropriate foreign key relationships between tables.

- **Test data generation:**
- Inserts randomly generated student, professor, subject, and grade data into the tables.
- **Data retrieval and display:**
- Retrieves and displays data from all tables.
- **SQL script execution:**
- Executes all SQL files located in the `SQL` subdirectory, allowing for more complex queries and analysis.## Usage
1. Clone this repository.
2. Install Python 3.
3. Run the main script: `python manage_db.py`
4. Follow the interactive prompts to perform database actions.## Available Commands
- **c**: Create database tables.
- **d**: Drop all database tables.
- **i**: Insert test data into tables.
- **s**: Show data from all tables.
- **q**: Execute all SQL files in the `SQL` subdirectory.
- **h**: Display this help menu.
- **x**: Exit the application.## Additional Notes
- The `constants.py` file contains various constants used throughout the application, such as database file name, SQL queries, and sample data.
- The `SQL` directory is intended for storing SQL files with specific queries or tasks.