*New* The MotherDuck Native Integration is Live on Vercel Marketplace for Embedded Analytics and Data AppsLearn more

CSV

Back to DuckDB Data Engineering Glossary

CSV (Comma-Separated Values) is a simple, text-based file format used to store tabular data. Each line in a CSV file represents a row, with individual values separated by commas. This format is widely supported by spreadsheet applications, databases, and data processing tools, making it a popular choice for data exchange and storage. CSV files are human-readable and can be easily edited with a text editor.

In DuckDB, you can work with CSV files using the read_csv function. For example:

Copy code

SELECT * FROM read_csv('data.csv', auto_detect=true);

This command reads a CSV file named 'data.csv' and automatically detects the column types. CSV files are particularly useful for small to medium-sized datasets and are often used as an intermediate format in data pipelines or for data export and import operations.