Below is my table:
Id Name City Managerid
------------------------------
1 Shawn NYC 3
2 Kevin Mumbai 4
3 Ryan Mumbai 1
4 Kanye SF 1
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:
alter table employee add gender varchar(50)
Now I understand I can add data one by one by using:
update employee
set gender = 'M'
where id = 1
But how do I add all 4 data at once?
Gendercolumn should bebit(if using a hetereonormative model) ortinyintif you have a domainenumyou can use, or at mostchar(1), but usingvarchar(50)could lead to meaningless data unless you have rigid check constraints - or you really mean to allow free-text entry.