Exporting data from custom field to an SQL table

I am looking for a way to get data held in custom fields within Pipedrive exported into a SQL, this would be trigged by a deal entering a specific stage. Can anyone recommend a way to achieve this?

Make may be able to help here … what type of database would be holding the table?