O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting records

To delete the phone number of an existing contact, we use the following code:

query = 'DELETE FROM contacts WHERE name = ?'self.execute_db_query(query, (name,))

The rest of the code is the supporting GUI. See 9.11_phonebook.py for the complete code. We have now completed coding a basic phone book application.

We have seen how to create a database, add tables to the database, and query the database to add, modify, delete, and view items in the database. Our phone book application has demonstrated how to execute basic CRUD operations on a database.

Furthermore, due to the similarity of basic database operations, you can now consider working with other database systems, such as MySQL, PostgreSQL, Oracle, Ingres, SAP DB, Informix, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required