Organize the following code to delete data, print the result, commit the changes, and don't forget to close the cursor and connection! Yes! In that order!
Delete data with SQLite
Delete & close
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
conn.close()
conn = sqlite3.connect('company.db')
cursor.close()
print("Total employees affected: ", cursor.rowcount)
cursor = conn.cursor()
conn.commit()
import sqlite3
cursor.execute("""DELETE FROM EMPLOYEE WHERE AGE > 55""")
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.