Connecting SqlLite3 database to Python and Reading it

Connecting SqlLite3 database to a Python file is actually 1 line of code:

conn = sqlite3.connect(r"C:\Users\database.db")

I have used a database from sqllitetutorial.net, which was rather neat. Then DB Browser for SQLLite a LEFT JOIN was implemented, in order to unite the two tables and to test the SQL completely:
At the end the data was printed, with title from the left and the names of the bands on the next column, starting with a tab:
This is achieved with row[0] and row[1]:

The 0-th index is the first column and 1-st index is the second column.


Cheers!

Tagged with: , , ,