This project is a Python-based tool for querying and analyzing a movie database stored in a PostgreSQL database. The tool allows users to perform various queries and retrieve information about movies, raters, and ratings.
Before running the project, ensure you have the following installed:
- Python 3.x
- PostgreSQL
-
Clone the repository:
-
Navigate to the project directory:
cd Assignment
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up the PostgreSQL database:
- Create a database and update the connection string in
database.py
with your database credentials.
- Create a database and update the connection string in
-
Run the main script to create the table and upload the data:
python main.py
Queries.py is using the function defined in Operations.py.
python Queries.py
-
Upon running
Query.py
, you will see an options menu with various query functionalities. -
Choose an option by entering the corresponding letter:
a
: Top 5 Movie Titlesb
: Number of Unique Ratersc
: Top 5 Rater IDsd
: Top Rated Moviese
: Favorite Movie Genre of Rater ID 1040f
: Highest Average Rating for a Movie Genre by Rater ID 1040g
: Year with Second-Highest Number of Action Moviesh
: Count of Movies with High Ratingsx
: Exit
-
Follow the on-screen instructions to interact with the tool.