PYTHON AND SQL
CONNECTIVITY
CREATING A TABLE USING IDLE
Imports the sqlite3 module.
Establishes a connection to the SQLite database
([Link]). If the database doesn't exist, it creates a
new one.
Creates a cursor object (cur) that allows executing SQL
commands.
Uses the cursor to execute an SQL command (CREATE TABLE
IF NOT EXISTS Students) to create a table named Students
with columns id, name, and age.
Commits the changes to the database to make them
permanent.
Closes the cursor and database connection.
This is a basic example of creating a database with a table.
You can modify the table schema and execute more SQL
commands using the [Link]() method to perform
various operations like inserting, updating, deleting data,
and querying the database.
INSERTING DATA AND DISPLAYING
This script does the following:
Inserts three records into the Students table
using INSERT statements.
Commits the changes to the database.
Fetches all records from the Students table
using SELECT * FROM Students.
Prints the fetched records.
AN EXAMPLE OF DATA ANALYZING, MANIPULATING
AND ORGANISING QUERIES AND SCRIPTS OF
CONNECTIVITY .(LIBRARY MANAGEMENT SYSTEM)