Question: Use the same database table that you designed in the previous assignment for Database Design Form ) and apply it to a Python program that
Use the same database table that you designed in the previous assignment for Database Design
Form and apply it to a Python program that performs CRUD operations. You can change your
table design if needed based on feedback you may have received from your instructor. Your
table must have at least columns not as shown in videos Write a program to perform
database CRUD operations on your table. Create a menu as shown below. Write multiple
functions as shown below. You can change the functions slightly, but must write multiple
functions and perform parameter passing and returning values. Watch the videos as a guide
for writing this program. You can use all of the code as presented in the videos, but you must
use a different table & columns than what was presented in the videos. Do not use the same
table book that was presented in the videos. Your table must have at least columns not
the video of book table only has columns
Welcome to my database program!
Menu:
Enter S to get started and create a new database
Enter C to create a new row
Enter R to retrieve data
Enter U to update a row
Enter D to delete a row
Enter Q to quit the program
Enter your choice:
Function Name Parameters Return Processing
main None Call connecttodb Call displaymenu.
connecttodb db
conn,
db
cursor
Connect to the database.
Get database cursor.
displaymenu db conn,
db cursor
None Loop: Display menu. Ask for user input. If invalid
menu choice, print error message and try again
If valid, call appropriate function. Commit to the
database. Call selectall to display rows. Ask user
if want to loop again. Quit loop if user chooses.
DDL Data Definition Language
createtable db cursor None Execute SQL: create
droptable db cursor None Execute SQL: drop
DML Data Manipulation LanguageCRUD
insertrow db cursor None Ask user for field values. Execute SQL: insert
selectall db cursor None Execute SQL select without where. Print results.
selectrow db cursor None Ask user for key.
Execute SQL select with where. Print results.
updaterow db cursor None Ask user for key. Ask user for new field values.
Execute SQL: update.
deleterow db cursor None Ask user for key. Execute SQL: delet
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
