Skip to content
Advertisement

Adding a new column with data

Below is my table:

Now I want to add a new column called ‘Gender’ with values M,M,M,F in 4 rows respectively.

I first added a new column using:

Now I understand I can add data one by one by using:

But how do I add all 4 data at once?

Advertisement

Answer

You don’t, unless there is some other piece of relational data that allows the engine to group the rows in someway. For example if all the males were in Mumbai. Alternatively, you can do it in 2 statements.

But this is still not useful if you have a large number of males and females that need to be updated after adding the column.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement