I have a large list of strings. I need to create a MySQL table where each string in the list is a name of a column (all columns are integers).
(I’m on python with sqlalchemy).
I looked at examples and it looks like I need to explicitly write each column in schema.Table, which is not so practical for a large list.
Is it possible?
Thanks
You could use tuple unpacking here.
And here’s an extended example of how you could use this to programmatically create the column names from a list of strings: