This code does not update the database, it's a SELECT query.
If you have FirstName and LastName it's generally against DB design principles to have also FullName as column. Keep atomic data. Note that SQLite3 does not support computed columns if you are after that.
You can create a view, if you want to have a full name and run queries against the view.
If after all you want to do it and create a new column in the table, then you need to create a column FullName and update its values from the other two columns:
If you have FirstName and LastName it's generally against DB design principles to have also FullName as column. Keep atomic data. Note that SQLite3 does not support computed columns if you are after that.
You can create a view, if you want to have a full name and run queries against the view.
If after all you want to do it and create a new column in the table, then you need to create a column FullName and update its values from the other two columns:
import sqlite3 with sqlite3.connect('test.db') as db: curr = db.cursor() curr.execute("ALTER TABLE Employee ADD COLUMN FullName TEXT;") curr.execute("UPDATE Employee SET FullName = FirstName || ' ' || LastName;") db.commit()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs