Deleting a record - Python
Tamamlama Gereklilikleri
Deleting a record
We can delete a record from the table (that is, delete a row and its data) by using the "DELETE FROM" statement:
# first, setup the query
query = ("DELETE FROM customers WHERE entryID=2")
# then execute
cursor.execute(query)
cnxn.commit() # and commit changes
The statement cnxn.commit() is required to make the changes to the table.
Deleting records (rows) decrease the total count of records in the table.