I’d like to refactor my database by splitting a single table into two. I’d like to moving a few existing columns to a new table. For instance, suppose I want to move the address field in the below Employee table to a new Address table.
How can I accomplish this using sqlite (or SQL if equivalent)?
Before:
Employee Table
employee_id (Primary)
name
address
city
After:
Employee Table
employee_id (Primary)
name
address_id
Address Table
address_id (Primary)
address
city
Try this:
Check here