How to update preferred language depending on a custom field in imported contacts?
It will be in a table called something like civicrm_value_ocsr_12 and the fieldname will look something like langue_57. You want to join on the entity_id column, e.g.

update civicrm_contact c left join civicrm_value_ocsr_12 v ON v.entity_id = c.id set c.preferred_language = 'fr_FR' where v.langue_57='F';

(I haven't tested that, just writing out the theory - I always get mixed up trying to get the right syntax for joins in an update statement.)