Develop Python code to implement some basic text-based functionality to allow the user to interact with the online electronics shopping database as outlined below.

a. Firstly, prompt for the entry of a shopper_id which will be used to test all the menu options. If the shopper_id entered is not found on the database, print an error message and exit the program otherwise print the main menu below.

b. Provide a text-based menu as follows:

ORINOCO – SHOPPER MAIN MENU
1. Display your order history
2. View your basket
3. Exit

c. Implement menu options 1, 2, 3 as follows:

Option 1 - Display your order history

i. For each order that the customer has placed, display the order id and order date together with the product description, seller name, price, quantity ordered and status of each product on that order. You can use your query from Part 1b as a basis for the SQL query in your Python code.

ii. Sort orders by order date (most recent first)

iii. If no orders are found for the shopper_id that you are testing with, print the message "No orders placed by this customer"

iv. Display the data in the format shown below (which is for shopper_id 10010) see image.

v. Return to the main menu

Option 2 - Display your basket

i. If the basket is empty, display an error message otherwise display all rows from the basket_contents table for the current basket as per the example below: see image.

ii. Return to the main menu

Option 3 - Exit

i. Exit the program

You should insert comments throughout your code to make it easier for someone else to understand.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.