working with sqlite in pythonDeleting, editing, displaying single and displaying all information from the database.
Using standard Python modules.
its just practice for students
for work and connect to db we need import sqlite
module:
import sqlite
we do not need to install this module
conn = sqlite3.connect("your-db-name.db")
if the db was found connect to that and if db not found create that.
- befure create query we need to select the db:
cur = conn.curser()
- now with this code we can make query to db:
cur.execute("CREATE TABLE persons(name varchar(100),number,age int)")
- now we must save all changes on db:
conn.commit()