Technology Sharing

Python operates SQLite3 database to add, delete, modify and query

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Python operates SQLite3 database to add, delete, modify and query

1. Create a SQLite3 database

It can be created by using Navicat graphical software:
insert image description here

2. Create a table

Use Navicat graphical software to create:
insert image description here
Every value stored in a SQLite database (or manipulated by the database engine) has one of the following storage types:

NULL. The value is the null value.
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes, depending on the value's size.
REAL. The value is a floating point number, stored as an 8-byte IEEE floating point number.
TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).
BLOB. A value is a block of data stored exactly as its input.

3. Add, delete, modify and check

Code:

# -*- coding: utf-8 -*-

"