{
  "id": 4193950,
  "title": "How to Set Up DuckDB (Run SQL on a CSV With No Import Step)",
  "url": "https://urgent.news/2026/08/29/how-to-set-up-duckdb-run-sql-on-a-csv-with-no-import-step",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-29T13:00:34.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/michaelnocito/how-to-set-up-duckdb-run-sql-on-a-csv-with-no-import-step-16nk"
  },
  "original_language": "en",
  "account": "DuckDB is a software library that allows running SQL queries directly on a CSV file without the need for any additional import steps. It automatically detects column types and provides a normal SQL result. To get started, install DuckDB using the command `python -m pip install duckdb`. Then, you can query the CSV file by writing a SQL query with the filename in quotes where a table name would typically go. For example, to select the top 5 countries by revenue from a CSV file named \"invoices.csv\", use the following command: `SELECT Country, COUNT(*) AS invoices, ROUND(SUM(Total), 2) AS revenue FROM invoices.csv GROUP BY Country ORDER BY revenue DESC LIMIT 5`.\n\nDuckDB infers the column types from the file contents, which can be verified using the `DESCRIBE` command. This feature extends beyond single files and can handle an entire folder of CSV files as one table by using an asterisk (*) in the filename. This eliminates the need for loops or manual concatenation of files. Additionally, DuckDB can interface with pandas, allowing seamless integration with data analysis workflows.",
  "summary": "By Michael Nocito , data analyst · Published August 8, 2026 By the end of this page you will be running SQL directly against a CSV file on your machine, with no import step, no CREATE TABLE , and no schema written by hand. DuckDB reads the file where it lies, works out the column types itself, and gives you a normal SQL result. It takes one command to install and about a minute to prove. Here is…",
  "key_points": [
    "DuckDB runs SQL on CSV files without import steps",
    "Automatically detects column types in CSV files",
    "Interfaces with pandas for seamless data workflow"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}