SQLITE3 date -- 19/08/2026

 import sqlite3


conn=sqlite3.connect("abab.db")


cursor=conn.cursor()


cursor.execute(

    """

CREATE TABLE IF NOT EXISTS students(

    id INTEGER PRIMARY KEY,

    name TEXT,

    age INTEGER

)

"""

)


cursor.execute("insert into students(name,age) values ('Gunjan',20);")

cursor.execute("insert into students(name,age) values ('Vishal',22);")

cursor.execute("insert into students(name,age) values ('Raghu',25);")



conn.commit()


cursor.execute("SELECT * FROM students;")

val=cursor.fetchall()


print(val)

for i in val:

    print(i)



conn.close()

Comments

Popular posts from this blog

Requests and Urllib

Strings in C Language

Dictionary in Python