Database / DuckDB Interview questions
What is a single-file DuckDB database?
A DuckDB database can be persisted as a single file on disk (conventionally with a .duckdb extension), containing all of the database's tables, indexes, and metadata in one self-contained file, similar in spirit to a SQLite database file.
import duckdb con = duckdb.connect("analytics.duckdb") con.execute("CREATE TABLE sales AS SELECT * FROM 'sales.csv'") con.close() # analytics.duckdb now contains the sales table persistently
This single-file model makes a DuckDB database trivially portable: copying, backing up, or sharing the entire database is as simple as copying that one file, with no separate configuration, data directory, or running service to coordinate. It's a natural fit for the same kinds of use cases SQLite's single-file model suits well: local applications, embedded analytics, and lightweight data distribution where standing up a full database server would be unnecessary overhead.
More Related questions...