Enron rental system is a GUI application that is created using Tkinter. It manages a fictional company called Enron Rentals. Inside the application, an end-user will be able to make changes to the database; they will be able to add new users, update the existing records, and perform various other tasks.
pip3 install tkinter
- Use the package manager pip3 to install mysql.connector.
pip3 install mysql.connector
-
Load the database correctly into MySQL from Project 2
-
Run the following SQL to create a vRentalInfo view :
USE project2;
-- DROP VIEW vRentalInfo;
CREATE VIEW vRentalInfo
AS SELECT OrderDate, StartDate, ReturnDate,
(Qty * RentalType) as 'TotalDays',
VechicleID AS 'VIN', Description AS 'Vehicle',
(CASE Type
WHEN 1 THEN "Compact"
WHEN 2 THEN "Medium"
WHEN 3 THEN "Large"
WHEN 4 THEN "SUV"
WHEN 5 THEN "Truck"
WHEN 6 THEN "VAN"
END) AS 'Type',
(CASE Category
WHEN 0 THEN "Basic"
WHEN 1 THEN "Luxury"
END) AS 'Category',
CustID AS 'CusomterID',
Name AS 'CustomerName',
TotalAmount AS 'OrderAmount',
(CASE WHEN PaymentDate IS NULL THEN TotalAmount ELSE 0
END) AS 'RentalBalance'
FROM Rental
NATURAL JOIN Customer
NATURAL JOIN Vehicle
NATURAL JOIN RATE;
SELECT * FROM vRentalInfo;
-
Change the password_database variable on enron.py to the user's root password.
-
Navigate to the directory and run the application by using the following command:
python3 enron.py
You will be greeted with a GUI to Enron Systems.