Check out example codes for "python sqlite". It will help you in understanding the concepts better.
Code Example 1
import sqlite3 try: sqliteConnection = sqlite3.connect('SQLite_Python.db') cursor = sqliteConnection.cursor() print("Database created and Successfully Connected to SQLite") sqlite_select_Query = "select sqlite_version();" cursor.execute(sqlite_select_Query) record = cursor.fetchall() print("SQLite Database Version is: ", record) cursor.close() except sqlite3.Error as error: print("Error while connecting to sqlite", error) finally: if (sqliteConnection): sqliteConnection.close() print("The SQLite connection is closed")
Code Example 2
# You can run SQLite3 on python without downloading anything. # The client is pre-installed in Python. import sqlite3 connection = sqlite3.connect("Database_name.db") cursor = connection.cursor() # Now you can run SQLite3 commands by doing this: cursor.excecute("WHATEVER COMMAND YOU WANT TO RUN")
Learn ReactJs, React Native from akashmittal.com