Database on the SD Card

The Arduino cannot do a real SQL database, but you have a filesystem if you use a SD card.
You can create a csv file to reflect a table.
If you need more tables, use multiple files.

Can you make a sketch how the components should work together as the goal is not clear.