How field values are stored in the database I'm working in a migration from Drupal 7 and I'm trying to find out where the value of some fields are. I've tried but could not find an answer for this on this site.

I see each field has a pair of tables:

field_data_field_{field_name}
field_revision_field_{field_name}


Some of the field_data tables have a column named field_{field_name}_value and that's easy to find.

However, other tables don't have this column and have one called field_{field_name}_target_id. Inside it they have an integer but I can not find where it is referenced to...

I'm looking only at the database, I don't have the code (yet) and I don't know if this is related to a module, or if this is Drupal native. Anyhow, I can't find any other table with the values that relate to these Ids...
Different field types can have different data columns in the database. Most modules have a 'value' column. Others, like reference fields, have a 'target_id' column instead. The Date module can create a 'value1' and 'value2' column (for start date / end date).

You can't assume that it is always 'value'.

The 'target_id' value refers to the ID of the entity being referenced. So, if the field is referencing nodes, target_id is holding a node id value. If the field was referencing users, the value stored is the user id.