Oh, understood!
-- Language PostgreSQL
-- schema:
-- Table = "actor", columns = [actor_id integer, first_name character varying, last_name character varying, last_update timestamp without time zone]
-- Table = "address", columns = [address_id integer, address character varying, address2 character varying, district character varying, city_id smallint, postal_code character varying, phone character varying, last_update timestamp without time zone]
-- Table = "category", columns = [category_id integer, name character varying, last_update timestamp without time zone]
-- Table = "city", columns = [city_id integer, city character varying, country_id smallint, last_update timestamp without time zone]
-- Table = "country", columns = [country_id integer, country character varying, last_update timestamp without time zone]
-- Table = "customer", columns = [customer_id integer, store_id smallint, first_name character varying, last_name character varying, email character varying, address_id smallint, activebool boolean, create_date date, last_update timestamp without time zone, active integer]
-- Table = "film", columns = [film_id integer, title character varying, description text, release_year integer, language_id smallint, rental_duration smallint, rental_rate numeric, length smallint, replacement_cost numeric, rating USER-DEFINED, last_update timestamp without time zone, special_features ARRAY, fulltext tsvector]
-- Table = "film_actor", columns = [actor_id smallint, film_id smallint, last_update timestamp without time zone]
-- Table = "film_category", columns = [film_id smallint, category_id smallint, last_update timestamp without time zone]
-- Table = "inventory", columns = [inventory_id integer, film_id smallint, store_id smallint, last_update timestamp without time zone]
-- Table = "language", columns = [language_id integer, name character, last_update timestamp without time zone]
-- Table = "payment", columns = [payment_id integer, customer_id smallint, staff_id smallint, rental_id integer, amount numeric, payment_date timestamp without time zone]
-- Table = "rental", columns = [rental_id integer, rental_date timestamp without time zone, inventory_id integer, customer_id smallint, return_date timestamp without time zone, staff_id smallint, last_update timestamp without time zone]
-- Table = "staff", columns = [staff_id integer, first_name character varying, last_name character varying, address_id smallint, email character varying, store_id smallint, active boolean, username character varying, password character varying, last_update timestamp without time zone, picture bytea]
-- Table = "store", columns = [store_id integer, manager_staff_id smallint, address_id smallint, last_update timestamp without time zone]
-- be sure to properly format and quote identifiers.
-- A postgreSQL query to SELECT 1 and
-- a syntactically-correct PostgreSQL query to What are the names of all the action films?
SELECT 1;
This template worked for 9/10 prompts in our (very small) test suite but failed for this one, where it returned
SELECT title FROM film WHERE category_id = 1
The codex model in particular is quite sensitive to changes in the prompt. It’s fairly easy to evoke the “right answer” for this prompt, but doing so can mess up some of the others (e.g. removing the admonition to correctly quote identifiers results in two or three of the tests failing).