Skip to main content

CALL prompt_schema

Describe contents of a database

You can ask MotherDuck AI to describe to you contents of your current database using the prompt_schema table function.

Syntax

CALL prompt_schema([include_tables=['<table_name>', '<table_name>']);

Example usage

We use MotherDuck's sample data database as sample.

Output of this SQL statement is a single column table with the following content:

summary
The database contains data related to various domains such as hacker news, ambient air quality, yellow cab trips in NYC, FHVHV trip data in NYC, and service requests to the 311 system in NYC.

Notes

MotherDuck AI operates on your current database by evaluating the schemas and contents of the database. You can specify which tables and columns should be considered, using the optional include_tables parameter. By default, all tables in the current database are considered. To point MotherDuck AI at a specific database, execute the use database command (learn more about switching databases).

These capabilities are provided by MotherDuck's integration with OpenAI.