Cursor Object
Before moving further to SQLite3 and Python let’s discuss the cursor object in brief.
- The cursor object is used to make the connection for executing SQL queries.
- It acts as middleware between SQLite database connection and SQL query. It is created after giving connection to SQLite database.
- The cursor is a control structure used to traverse and fetch the records of the database.
- All the commands will be executed using cursor object only.
SQL using Python
In this article, integrating SQLite3 with Python is discussed. Here we will discuss all the CRUD operations on the SQLite3 database using Python. CRUD contains four major operations –
Note: This needs a basic understanding of SQL.
Here, we are going to connect SQLite with Python. Python has a native library for SQLite3 called sqlite3. Let us explain how it works.