Question: Show me the steps to solve in python: Make a program to extract SQL data into JSON object or vise versa based on user's selection.

Show me the steps to solve in python:
Make a program to extract SQL data into JSON object or vise versa based on user's selection. Also, user will be allowed to enter custom SQL in from the prompt.
You will need to use the same data.JSON
The example output is below, you can structure your code however you want.
Example Outputs:
--------------------------------------------------------
1- Load JSON data into Database
2- Export Database to JSON object
3- Custom SQL Command
4- Print All data in Database
Q quit
--------------------------------------------------------
1
You selected to load data into JSON. (Check for JSON file extension and if file exist, you can always assume user will pass file format)
Please enter JSON file name: data.txt
Unfortunately, txt format is not supported, only JSON format.
Please enter JSON file name: data_2.JSON
File data_2.JSON was not found. Please make sure you didn't misspell file name.
Please enter JSON file name: data.JSON
File Found, data.JSON has 10 objects. Loading into database.
--------------------------------------------------------
1- Load JSON data into Database
2- Export Database to JSON object
3- Custom SQL Command
4- Print All data in Database
Q quit
--------------------------------------------------------
2
Exporting all data to JSON object.
Please enter the name for the export file: (Do not allow saving any format except JSON)
example.txt
Unfortunately .txt is not supported format, only JSON.
example.JSON
File is created and ready for use.
--------------------------------------------------------
1- Load JSON data into Database
2- Export Database to JSON object
3- Custom SQL Command
4- Print All data in Database
Q quit
--------------------------------------------------------
3
Please enter your custom SQL, there is only one table named Users, and here is the list of columns: (Do not allow anything but Select)
ID, Name, Age, City, State and PhoneNumber (This part is up to you, whatever you named your columns print it here)
Delete * from Users
Sorry Delete is not allowed, only Select.
Select * from User
Sorry something went wrong (if any error occurs you can just say 'something went wrong')
Select * from Users
-----------------
User ID: 0
Alex Anderson
Omaha, NE
21
402-123-4567
-----------------
User ID: 13
Seth Green
Denver, CO
19
402-233-3232
Do you wish to continue (Y) or back to main menu (B)?(if sql was valid, ask user this question, user can enter lower or upper case doesn't matter, account for that)
B
--------------------------------------------------------
1- Load JSON data into Database
2- Export Database to JSON object
3- Custom SQL Command
4- Print All data in Database
Q quit
--------------------------------------------------------
Q
Terminating Program, Good Bye!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!