Why does MySQL return error on creating a table?

I’ve been trying to create a table with user input name but I get an error no matter how I write the query. right now query is like this: query=("CREATE TABLE "+t+" ( NAME VARCHAR , DISTANCE VARCHAR , PRICE VARCHAR , LOCATION VARCHAR)") and after running the whole code it returns: mysql.connector.errors.ProgrammingError: 1064 (42000):… Read More Why does MySQL return error on creating a table?

Querying data with common words using python connector — avoid code duplication

I am new to SQL and relatively new to python. I’m trying to fetch some information from the database using mysql.connector. And I found myself copying and pasting a lot. I tried using LIKE so that I could just execute once and collect all that includes the common word, but I couldn’t figure out the… Read More Querying data with common words using python connector — avoid code duplication

python-mysql-connector: I need to speed up the time it takes to update multiple items in mySQL table

I currently have a list of id’s approx. of size 10,000. I need to update all rows in the mySQL table which have an id in the inactive_ids list that you see below. I need to change their active status to ‘No’ which is a column in the mySQL table. I am using mysql.connector python… Read More python-mysql-connector: I need to speed up the time it takes to update multiple items in mySQL table