fortunewalla / flughafendb

The Flughafen DB repository containing a large MySQL data set for training, learning and testing
0 stars 0 forks source link

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

Closed fortunewalla closed 1 year ago

fortunewalla commented 1 year ago

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

fortunewalla commented 1 year ago

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';
fortunewalla commented 1 year ago

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)