Activity 01
Pair Programming: CRUD Functions
Pairs import sqlite3 and write functions for INSERT, UPDATE, and DELETE on a 'students' table with fields like name, roll_no, marks. Test each by executing and verifying with SELECT queries. Pairs swap scripts to test and fix errors in partner's code.
Explain how to execute SQL INSERT, UPDATE, and DELETE statements from a Python script.
Facilitation TipIn pair programming, rotate roles every 5 minutes so both students engage equally with writing and testing queries.
What to look forPresent students with a Python code snippet that attempts to insert data into a table with a missing column. Ask them to predict the error message and explain why it occurs. Then, have them write the correct query using placeholders.