Week 13 • Monday

Block 121: SQLite Basics with Python

Create databases and tables from Python.

Concepts

Code Examples

See exercise below.

Exercise

Create a database with a 'students' table (id, name, grade). Insert 5 rows. Query all rows and print them.

Homework

What is the difference between conn.commit() and conn.close()? What happens if you forget commit()?