I have been trying to insert column list into table but unable to do so here is what i want to do
Let say i have a list of column names column=["Email","Name","Salary"]
and i want to insert these columns into a table without hardcoding them , using column list only what is the best and easy way of doing it , i have read multiple answers but unable to understand , as i am a beiginer please explain it in basic manner , in python
i have tried it using
column=["Email","Name","Salary"]
'''CREATE TABLE IF NOT EXISTS EMPLOYEE(? TEXT NOT NULL,? TEXT NOT NULL,? TEXT NOT NULL)''',(column[0],column[1],column[2])
but i am getting the syntax error Please help me i am beginner
One approach would be to use an f-string in python to create your sqlite instructions. So, you could do: