Excel
Excel workbooks can be loaded through DuckDB's Excel extension and stored in MotherDuck for repeatable SQL analysis.
note
Excel files load through a DuckDB client using read_xlsx (shown below). The MotherDuck UI Add data uploader supports CSV, Parquet, and JSON, but not .xlsx. To load an Excel file, use the DuckDB CLI or another DuckDB client, or convert the file to CSV first.
How it works with MotherDuck
- Connect to MotherDuck from a DuckDB client.
- Install and load the DuckDB Excel extension in the client session.
- Use
read_xlsxto read a workbook and create a MotherDuck table from the result.
Example
INSTALL excel;
LOAD excel;
CREATE TABLE my_table AS
SELECT *
FROM read_xlsx('workbook.xlsx');
To read a specific worksheet, pass the sheet parameter:
CREATE OR REPLACE TABLE my_database.main.excel_data AS
SELECT *
FROM read_xlsx('workbook.xlsx', sheet = 'Sheet1');
