SQLite with Python for Computer Science GCSE and A Level

In this article we will learn how to use the SQLite database management system with Python for GCSE and A Level Computer Science.

You will need to know about how SQL works for GCSE Computer Science with OCR and it will certainly help with Computer Science GCSE with Edexcel and Cambridge, although in those syllabuses you technically only need to know about database structure rather than SQL specifically. For A Level, knowledge of SQL is required by almost all the boards.

The video above explains the following points:

  • Importing SQLite into Python
  • Making a connection to a SQLite database
  • Using a cursor to read and write data
  • Inserting data in to a SQLite database using INSERT.
  • Reading data from a SQLite database using SELECT
  • Committing changes
  • Closing the connection to the database.

The context of this exercise is creating a table to store information about the topics in the OCR GCSE Computer Science syllabus. The full listing is provided below for your convenience.

Please feel free to comment and ask any questions you may have in the comments section below.

Python Listing for SQLite Database Example

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get the code for the classic Retro Alien Blitz Game using Python Turtle Graphics when you join our mailing list