Back to Code Snippets

Carlo Piovesan

@carlo


Load AWS credentialsSQL

Execute this SQL

CALL load_aws_credentials();
--- duckdb >= v0.9.0, AWS and httpfs extension loaded on the fly

Copy code

Carlo Piovesan

Copy code

Expand

Share link


SUMMARIZE

Editor's note: the SUMMARIZE() function allows you to quickly understand your data. If you want to understand a little more about how it works under the hood, see Hamilton's other snippet on building your own SUMMARIZE() capabilities using built-in analytics functions.

Execute this SQL

SUMMARIZE some_tbl;
SUMMARIZE from 'some_file.csv';
--- summary informations about a given table

Copy code

Carlo Piovesan

Expand

Share link


ATTACH 'other.db';

Editor's note: DuckDB allows you to attach multiple databases at once. For example, you can attach a local file, an in-memory database and a database from MotherDuck and work with all of them simultaneously. The ATTACH statement is executed for each database to be attached.

Execute this SQL

-- attach another database, alias inferred from the name ("other")
ATTACH 'other.db';
SELECT * FROM other.some_table;

Copy code

Carlo Piovesan

Expand

Share link