Q:

How to replace part of column String SQLite3 with Python

I have a database with some problematic characters in a specific column from improper importing, and I want to replace them with the proper ones. 
For example, I want to replace &quot; with " where ever it is found in a string in the column English of the Table Data.
I'm using the following code to no avail:
conn = sqlite3.connect('Solutions.db')
c = conn.cursor()
sql = """SELECT English, replace(English,'&quot;','"') FROM Data"""
c.execute(sql)
records = c.fetchall()
print("Total rows are:  ", len(records))
print("Printing each row")
for row in records:
    print(row[0])
    print("\n")
conn.commit()

I noticed in the debugger that the sql = line translates like this:
sql = SELECT English, replace(English,\ `'&quot;` \',\'"\') FROM Data

It is putting a \ before every ' and I don't know if this is normal behavior. 
Either way, I'm not getting the characters replaced, but if I run the same exact command directly into the sqlite3 it makes the changes just fine.
I'm using Python 3.7.5
Thanks in advance.

A:

The problem here is you are printing the first column which is English whereas the replacement is actually happening in the second column of your resultset. 
if you update the following line to look for index 1 instead of 0, you'll get the correct results.
...
for row in records:
    print(row[1])  # print the second column defined by your replace function.
    print("\n")
...

However, it is still not going to update the actual data in the database because SELECT only queries the data and REPLACE is performed on the queried copy of the data. To update the data in your database, you need to perform the UPDATE operation on the database column.
UPDATE
    Data
SET
    English = REPLACE(English,'&quot;','"');

