If you are using Oracle, then you can use
external tables.
Basically, Oracle
external tables allow you to define a SQL table structure over a flat file e.g. in CSV format. Because this looks like any other table inside Oracle, you can then perform SQL operations on the table e.g. to compare its contents with other tables in your database. Generally if your external table is based on a CSV file then you can only read from it within Oracle i.e. you cannot write back to the CSV file.
External tables are especially useful if you have to upload large volumes of data into your database from a flat file format such as CSV: put your file in the appropriate Oracle directory, define your external table to point to that file, then simply use SQL to SELECT the data from the external table and INSERT/MERGE it into a normal relational table in the database. This bulk loading mechanism is much faster than reading records from a CSV file e.g. in
Java and using individual INSERTs to write them to the DB.
Of course, if you're not using Oracle, then you're out of luck!