How to connect Arduino to Database?

Why output to a CSV? The OP wants to write to a database.

To me, the posted image looks like a simple spreadsheet/CSV.