fortunewalla / flughafendb

The Flughafen DB repository containing a large MySQL data set for training, learning and testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the `sex` column value `w` to `f` in `passengerdetails`

fortunewalla opened this issue · comments

The German short form for female is w. This needs to be changed to the English short form for female which is f.

Change the sex column value w to f in passengerdetails

what it currently looks like

mysql> select sex, count(sex) from employee group by sex;         
+------+------------+                                             
| sex  | count(sex) |                                             
+------+------------+                                             
| m    |        815 |                                             
| f    |        185 |                                             
+------+------------+                                             
2 rows in set (0.00 sec)                                          
                                                                  
mysql> select sex, count(sex) from passengerdetails group by sex; 
+------+------------+                                             
| sex  | count(sex) |                                             
+------+------------+                                             
| m    |      28752 |                                             
| w    |       7343 |                                             
+------+------------+                                             
2 rows in set (0.03 sec)                                          
                                                                  

this should work

UPDATE passengerdetails
SET sex='f'
WHERE sex = 'w';

seems to have worked.

mysql> UPDATE passengerdetails                                    
    -> SET sex='f'                                                
    -> WHERE sex = 'w';                                           
Query OK, 7343 rows affected (0.37 sec)                           
Rows matched: 7343  Changed: 7343  Warnings: 0                    
                                                                  
mysql> select sex, count(sex) from passengerdetails group by sex; 
+------+------------+                                             
| sex  | count(sex) |                                             
+------+------------+                                             
| m    |      28752 |                                             
| f    |       7343 |                                             
+------+------------+                                             
2 rows in set (0.03 sec)