I find it difficult to fill a new column that I just added to an already existing table in SQL
I tried the Insert command, to fill in the table afresh, but couldn’t see it true because the table has 1445 rows
I find it difficult to fill a new column that I just added to an already existing table in SQL
I tried the Insert command, to fill in the table afresh, but couldn’t see it true because the table has 1445 rows
2
Answers
You could specify a default value when you add the column:
Alternatively, once you added the column, you could use an
update
statement:Just like the answer above you can use ALTER TABLE to add a new column
Then you can use the update and add a where statement to be more specific
Alternatively you could try using Five, you can import your database in it as an SQL dump, it actually allows you to do way more with new columns, like copy data from an existing field in the table or fill in the values from a query
here is an image of Five prompting you to fill in values for a new column
there are other things as well like you can write queries directly in Five, reuse the queries and the tables can be generated with simple point and click.
Disclaimer: I work for Five