Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Connect and cursor | Introduction to SQLite
SQL in Python Projects
course content

Зміст курсу

SQL in Python Projects

SQL in Python Projects

1. Development Environment on Your PC
2. Introduction to SQLite
3. CRUD
4. More About SQLite

bookConnect and cursor

Connect to DB

Before creating a table, you need to:

  • Import the library;
  • Connect or create a database;

Establish a connection to the database (or create a new one if it doesn't exist) where 'my_database.db' is the database name.

  • Create a cursor;

Create a cursor for executing SQL queries.

A cursor is a tool for working with data in a database, like a virtual pointer to access and manage information.

The cursor is an object that allows you to interact with the database and execute SQL queries. The cursor defines which part of the database you are currently interacting with.

After running the code, you will have access to the "my_database.db" database and a ready-to-use cursor for executing SQL queries. If the database didn't exist previously, it will be created upon running this code.

  • my_database.db in the project folder is the database file.

In the next section, we will create the first table.

What is a cursor?

What is a cursor?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 3
some-alt